-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
39 lines (32 loc) · 1.28 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#Move to world
from pandac.PandaModules import loadPrcFileData
size = width, height = 480, 320
loadPrcFileData("", "window-title test")
loadPrcFileData("", "fullscreen 0") # Set to 1 for fullscreen
loadPrcFileData("", "win-size %s %s" % (width, height))
loadPrcFileData("", "win-origin 10 10")
loadPrcFileData("", "textures-power-2 pad")#makes panda pad non-p2-sizes instead of downscaling
import panda2d_xml
import panda2d_xml.sprites
class Mundo(panda2d_xml.World):
def __init__(self):
panda2d_xml.World.__init__(self, size[0], size[1], bgColor=(100, 0,0), debug=True )
self.addSprites()
def addSprites(self):
self.atlas = panda2d_xml.sprites.Atlas("data", fanim="newAnimation.anim")
self.sp = self.atlas.newSprite('r6', self.node)
self.sp.setPos(50.0, 50.0, 50.0)
self.WALKING = self.atlas.animIndex("Animation")
self.sp.play(self.WALKING)
# class Cat(panda2d.sprites.AnimatedSprite):
# def __init__(self, atlas, node):
# panda2d.sprites.AnimatedSprite.__init__(self, atlas, node )
# self.WALKING = self.atlas.animIndex("cat_walking")
# self.HIT = self.atlas.animIndex("cat_hit")
# self.JUMPING = self.atlas.animIndex("cat_jump")
# self.play(self.WALKING)
# self.setPos(30, 0, 60)
# self.m = taskMgr.add(self.move, 'cat move')
# pass
world = Mundo()
run()