-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.py
58 lines (37 loc) · 1.02 KB
/
state.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
# GpNeWJV9rN
import random
import os
from pygame.sprite import Sprite
from pygame import Surface
from retrogamelib.util import *
from retrogamelib.camera import *
from constants import *
class State(object):
def __init__(self):
super(State, self).__init__()
self.running = True
self.loaded = False
self.change_state = ""
self.surf_main = Surface(WIN_SIZE)
def on_load(self, camera=None, font=None, fps=None):
self.loaded = True
if camera:
self.cam = camera
self.paracam = ParallaxCamera(self.cam, 2, 2)
if font:
self.font = font
if fps:
self.fps = fps
def on_resume(self):
self.running = True
def on_event(self, e):
pass
def on_update(self):
pass
def on_collision(self):
pass
def on_animate(self):
pass
def on_render(self):
pass