view nagslang/screens/base.py @ 34:2995723e8ccf

Move and hold.
author Simon Cross <hodgestar@gmail.com>
date Sun, 01 Sep 2013 16:50:06 +0200
parents 347667c941de
children 4140780c21bc
line wrap: on
line source

"""A screen or area in which action happens."""

from pygame import event
import pymunk


class Screen(object):

    def __init__(self):
        self.space = pymunk.Space()

    def setup(self, world):
        """Perform setup based on the world state."""
        pass

    def teardown(self):
        pass

    def post_event(self, ev):
        event.post(ev)

    def handle_event(self, ev):
        pass

    def render(self, surface):
        pass

    def tick(self, seconds):
        """Step the given amount of time."""
        self.space.step(seconds)