source: nagslang/screens/base.py@ 192:3dc2b6290e66

Last change on this file since 192:3dc2b6290e66 was 180:026297a03963, checked in by Neil Muller <drnlmuller@…>, 8 years ago

Add DoorEvent and tweak ScreenChange to keep more state when the player goes through a door

File size: 660 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, player, world):
10 self.name = name
11 self.world = world
12 self.protagonist = player
13 self.space = pymunk.Space()
14
15 def setup(self):
16 """Perform setup based on the world state."""
17 pass
18
19 def teardown(self):
20 pass
21
22 def post_event(self, ev):
23 event.post(ev)
24
25 def handle_event(self, ev):
26 pass
27
28 def render(self, surface):
29 pass
30
31 def tick(self, seconds):
32 """Step the given amount of time."""
33 self.space.step(seconds)
Note: See TracBrowser for help on using the repository browser.