-
Notifications
You must be signed in to change notification settings - Fork 0
/
chara.py
35 lines (31 loc) · 1.04 KB
/
chara.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
#character creator
import numpy
from level import Extra
class Character:
def __init__(self, charID, emoji, start, direction, state, corner = [1,1], counter = 0, cooldown = 0):
self.id = charID
self.display = emoji
self.coord = start
self.state = state
self.direction = direction
self.origin = start.copy()
self.corner = corner
self.counter = counter
self.cooldown = cooldown
self.prevspace = start.copy()
def changeemoji(self, state):
self.state = state
if self.id == "pac":
if state == "begin":
self.display = Extra[0]
elif state == "powerup":
self.display = Extra[2]
elif state == "dead":
self.display = Extra[1]
else:
if state == "random" or state == "chase":
self.display = Extra[self.id]
elif state == "run":
self.display = Extra[7]
elif state == "dead":
self.display = Extra[17]