def init(style = None): """ Intialise \\module{soya.pudding}. \\var{style} should be a subclass of \\class{soya.pudding.style.Style} """ global STYLE print "* Soya Pudding * Version: %s" % __version__ STYLE = style or Style() # lets just turn this on whatever # using text inputs without unicode is really painfull unless you care about # using A-Z soya.set_use_unicode(1)
if __name__=='__main__': soya.init(width=800,height=600,title="Balazar Bomber") #soya.init_audio() # play our music file on loop forever :D #music=soya.MusicFile(os.path.join(SOUNDS,'test.mod')) #music.play(-1) # we load this for later #explosion_sound=soya.AudioFile(os.path.join(SOUNDS,'explosion.wav')) #bonus_sound=soya.AudioFile(os.path.join(SOUNDS,'arcade.wav')) # turn on unicode key events for better text input soya.set_use_unicode(True) # the global state machine object stateMachine=StateMachine() # all our application states stateMachine['intro']=IntroIdler stateMachine['menu']=MainMenuIdler stateMachine['lobby']=LobbyIdler stateMachine['game']=GameIdler # run the first state clientplayer.state = "intro" stateMachine.state= clientplayer.state
elif options.snowballz: import snowballz r = SnowballzLevelReader(options.filename, verbose=options.verbose, level=snowballz.Level) setModuleScene = snowballz else: r = LevelReader(options.filename, verbose=options.verbose) r.save(options.output) if not options.view: print "done." else: soya.init(title="LevelXML", width=1024, height=768) soya.set_use_unicode(1) scene = soya.World() if setModuleScene: setModuleScene.scene = scene level = soya.World.get(options.output) scene.add(level) camera = r.get_camera(scene=scene) camera.back = 500.0 soya.set_root_widget(widget.Group()) soya.root_widget.add(camera)