Esempio n. 1
0
    def switch(self, name):
        """Switch to a new screen by saving the current state, and then
            restoring the specified state."""

        State.save(State.name)
        State.prev_name = State.name
        State.restore(name)
Esempio n. 2
0
    def create_screens(self):
        """Create all of the game screens specified in the game
            configuration."""

        for name in State.game['screens']:
            State.screen = Screen(name)
            State.save(name)
Esempio n. 3
0
 def __init__(self, name):
     State.name = name
     State.screen = self
     State.controls = State.screens[State.name]['controls']
     State.groups = {}
     self.layers = LayeredDirty()
     self.add_all()
     State.save(State.name)
Esempio n. 4
0
    def create_screen(self, name):
        """Create a new screen and save it to a state of the same name for
            retrieval."""

        State.screen = Screen(name)
        State.save(name)
Esempio n. 5
0
    def add_object(self, screen, object, amount=1, pos=None):
        """Add one or more instances of an object to a screen."""

        State.restore(screen)
        State.screen.add_object(object, amount, pos)
        State.save(screen)