Placebo - Python library on create games or other applications
from placebo.engine import init, Engine
using:
init()
myGame = Engine("My first game", 1200, 720)
myGame.start()
import class:
from placebo.engine import init, Engine, Scene
create new scene nameScene = Scene(sceneName)
mainScene = Scene('main')
add scene to engine:
myGame.add(mainScene)
go to scene:
myGame.goTo('main') # go to other scene
import class:
from placebo.engine import init, Engine, Scene, Object
create new object objectName = Object(objectName)
firstObject = Object('firstObject')
add object to scene:
mainScene.add(firstObject)
import class:
from placebo.engine import init, Engine, Scene, Object, Component
create personal component:
class MyFirstComponent(Component):
# this method run only once
def init(self, object, scene, engine):
print("Component '%s' initialed!", % self.name)
# this method run only one game cycle
def update(self, object, scene, engie):
print("'%s' → is runned!", % self.name)
myFirstComponent = MyFirstComponent('firstComponent')
add component into object:
firstObject.add(myFirstComponent)