|
@@ -89,8 +89,8 @@ class LevelModel:
|
|
|
# TODO: set background image (background[0|1|2].png) from "background" + map.backgroundTex + ".png"
|
|
|
|
|
|
for x in range(64):
|
|
|
- for y in range(64):
|
|
|
- item = self.map.levelMap[x][y]
|
|
|
+ for z in range(64):
|
|
|
+ item = self.map.levelMap[x][z]
|
|
|
if not item[0]:
|
|
|
continue
|
|
|
else:
|
|
@@ -100,8 +100,8 @@ class LevelModel:
|
|
|
ceil_tex = self.map.ceilDict[item[0]][0]
|
|
|
ceil_ht = self.map.ceilDict[item[0]][1]
|
|
|
# print("tile: %s, %s, %s" % (tile_index, item[0], floor_ht))
|
|
|
- self.add_block(0-x, floor_ht / 4, 0-y, floor_tex)
|
|
|
- self.add_block(0-x, 8 - ceil_ht / 4, 0-y, ceil_tex)
|
|
|
+ self.add_block(0-x, floor_ht / 4, 0-z, floor_tex)
|
|
|
+ self.add_block(0-x, 8 - ceil_ht / 4, 0-z, ceil_tex)
|
|
|
|
|
|
for e in self.map.elements:
|
|
|
# if below a certain value, it's from itemSprites
|
|
@@ -222,6 +222,8 @@ class Window(pyglet.window.Window):
|
|
|
self.model.load_level_image('testlvl1.gif')
|
|
|
self.player = Camera(self.model.map.playerStart, (-30,0))
|
|
|
|
|
|
+ self.debugLabel = pyglet.text.Label('Player pos: ', x=self.width//2, y=self.height//2)
|
|
|
+
|
|
|
def on_mouse_motion(self,x,y,dx,dy):
|
|
|
if self.mouse_lock: self.player.mouse_motion(dx,dy)
|
|
|
|
|
@@ -233,12 +235,15 @@ class Window(pyglet.window.Window):
|
|
|
|
|
|
def update(self, dt):
|
|
|
self.player.update(dt, self.keys)
|
|
|
+ self.debugLabel.text = 'Player pos: ' + str(self.player.pos[0])
|
|
|
|
|
|
def on_draw(self):
|
|
|
self.clear()
|
|
|
self.set3d()
|
|
|
self.push(self.player.pos,self.player.rot)
|
|
|
self.model.draw()
|
|
|
+ self.set2d()
|
|
|
+ self.debugLabel.draw()
|
|
|
glPopMatrix()
|
|
|
|
|
|
|