source: nagslang/screens/base.py@ 293:47226c661ae2

Last change on this file since 293:47226c661ae2 was 276:3153196517fc, checked in by Neil Muller <drnlmuller@…>, 8 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.