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