-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreaturebase.py
More file actions
34 lines (31 loc) · 1.08 KB
/
creaturebase.py
File metadata and controls
34 lines (31 loc) · 1.08 KB
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
import reagons as rg
try:
import sense_hat as sho
sh=sho.Sensehat()
except:
import sense_emu as sho
sh=sho.SenseHat()
global tmap,change
class BaseEntityModel(rg.Map):
def __init__(self):
self.hp = 100
self.dead = False
self.anibuffer=[]
self.color = [0, 0, 0]
self.x, self.y, self.z, self.world = 0, 0, 0, 0
self.tx, self.ty, self.tz = 0, 0, 0
self.mx, self.my, self.mz = 0, 0, 0
self.lcolor = [0, 0, 0]
self.lx, self.ly, self.lz, self.lworld = 0, 0, 0, 0
self.ltx, self.lty, self.ltz = 0, 0, 0
self.lmx, self.lmy, self.lmz = 0, 0, 0
def render(self,tmap,change):
if not tmap:
tmap=[]
for i in range(64):
tmap.append([0,0,0])
if 1: print([self.x, self.y], [self.lx, self.ly])
if [self.mx, self.my, self.mz, self.world] == [super().cmx, super().cmy, super().cmz, super().cworld]:
sh.set_pixel(self.x,self.y,self.color)
if not change:
sh.set_pixel(self.lx,self.ly,tmap[self.lx+(self.ly*8)])