-
Notifications
You must be signed in to change notification settings - Fork 0
/
ent.py
58 lines (41 loc) · 1.29 KB
/
ent.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
import entdefs as ed
#import sprites as sprites
class Ent:
valid = True # invalid ents are removed at the end of the day
#gravity = 0.5 No sirve aca
kind = "unknown"
solid = False
width, height = 32,32
x,y = 0,0 # Pos
momx,momy = 0,0 # momentum across axis
gx,gy = 0,0 # Graphic pos
gang = 0
lifetime = 0
dodraw = True
sprite = "error"
#fuckingdie = False
def __init__(self, kind):
#kind has to be an entdef index i spose lol
#me = ed.get(kind)
self.kind = kind #bro
self.width = ed.getprop(kind, "width")
self.height = ed.getprop(kind, "height")
#self.gravity = ed.getprop(kind, "gravity")
self.sprite = ed.getprop(kind, "sprite")
self.solid = ed.getprop(kind, "solid")
self.daemon = ed.getprop(kind, "daemon")
self.colldaemon = ed.getprop(kind, "colldaemon")
def castDaemon(self, gs):
self.lifetime += 1
ed.commonDaemon(self, gs)
self.daemon(self, gs)
def castCollDaemon(self, gs, other):
self.colldaemon(self, gs, other)
def _assign(self, kind):
#entdefs["none"]["daemon"](self)
pass
def setpos(self, x, y):
self.x = x
self.y = y
def kill(self):
self.valid = False