while x != x1:
if x in range(0, World.worldWidth - 1) and y in range (0, World.worldHeight - 1) and not World.world[int(y)][int(x)].containsSolid():
World.world[int(y)][int(x)].visible = True
+ World.world[int(y)][int(x)].seen = True
Debug.debugRects.append((x, y, (255, 0, 0)))
err -= dy
if err < 0:
while y != y1:
if x in range(0, World.worldWidth - 1) and y in range (0, World.worldHeight - 1) and not World.world[int(y)][int(x)].containsSolid():
World.world[int(y)][int(x)].visible = True
+ World.world[int(y)][int(x)].seen = True
Debug.debugRects.append((x, y, (255, 0, 0)))
err -= dx
if err < 0:
else:
break
World.world[int(y)][int(x)].visible = True
+ World.world[int(y)][int(x)].seen = True
Debug.debugRects.append((x, y, (255, 0, 0)))
def __init__(self):
self.objects = [] # order this list somehow to get Z
self.visible = True
+ self.seen = False
def containsSolid(self):
return any(ob.solid for ob in self.objects)
\ No newline at end of file
for y in range(World.worldHeight):
for x in range(World.worldWidth):
- if (World.world[y][x].visible):
+ if (World.world[y][x].seen):
for gameObj in World.world[y][x].objects:
worldX = (gameObj.worldX * actualWidth) - (actualWidth / 2)
worldY = (gameObj.worldY * actualHeight) - (actualHeight / 2)
actualWidth,
actualHeight))
+ if not World.world[y][x].visible:
+ gameObj = World.world[y][x].objects[0]
+ worldX = (gameObj.worldX * actualWidth) - (actualWidth / 2)
+ worldY = (gameObj.worldY * actualHeight) - (actualHeight / 2)
+ tCoord = Texture.spriteDict["prev_seen"]
+ self.screen.blit(sheet,
+ (worldX - screenTopX, worldY - screenTopY),
+ (tCoord[0] * actualWidth,
+ tCoord[1] * actualHeight,
+ actualWidth,
+ actualHeight))
+
worldX = (player.worldX * actualWidth) - (actualWidth / 2)
worldY = (player.worldY * actualHeight) - (actualHeight / 2)
self.screen.blit(sheet, (worldX - screenTopX, worldY - screenTopY),
"wall_slime" : (4, 1),
"wall_side" : (5, 1),
"floor_tile" : (0, 2),
- "floor_panels" : (1, 2)
+ "floor_panels" : (1, 2),
+ "prev_seen" : (0, 3)
}
# spriteDict = {
# "player" : (1, 19),