source: nagslang/screens/base.py @ 276:3153196517fc

Last change on this file since 276:3153196517fc was 276:3153196517fc, checked in by Neil Muller <drnlmuller@…>, 7 years ago

Move protagonist to the world

File size: 618 bytes
Line 
1"""A screen or area in which action happens."""
2
3from pygame import event
4import pymunk
5
6
7class Screen(object):
8
9    def __init__(self, name, world):
10        self.name = name
11        self.world = world
12        self.space = pymunk.Space()
13
14    def setup(self):
15        """Perform setup based on the world state."""
16        pass
17
18    def teardown(self):
19        pass
20
21    def post_event(self, ev):
22        event.post(ev)
23
24    def handle_event(self, ev):
25        pass
26
27    def render(self, surface):
28        pass
29
30    def tick(self, seconds):
31        """Step the given amount of time."""
32        self.space.step(seconds)
Note: See TracBrowser for help on using the repository browser.