1
# This code is so you can run the samples without installing the package
4
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
9
from cocos.director import director
10
from cocos.actions import *
11
from cocos.layer import *
13
class BackgroundLayer( cocos.layer.Layer ):
15
super( BackgroundLayer, self ).__init__()
16
self.img = pyglet.resource.image('background_image.png')
22
if __name__ == "__main__":
23
director.init( resizable=True, fullscreen=False )
24
main_scene = cocos.scene.Scene()
26
main_scene.add( BackgroundLayer(), z=0 )
28
e = FadeOutDownTiles( grid=(16,12), duration=2 )
29
main_scene.do( e + Reverse(e) )
31
director.run (main_scene)