Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game1/tracktmx.py
diff options
context:
space:
mode:
Diffstat (limited to 'game1/tracktmx.py')
-rwxr-xr-xgame1/tracktmx.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/game1/tracktmx.py b/game1/tracktmx.py
index d99bade..51d76d7 100755
--- a/game1/tracktmx.py
+++ b/game1/tracktmx.py
@@ -96,7 +96,10 @@ class Track():
x = (xpos + layer.x) * self.world_map.tilewidth
y = (ypos + layer.y) * self.world_map.tileheight
# get the gid at this position
- img_idx = layer.content2D[xpos][ypos]
+ ypos_safe = ypos
+ if ypos_safe >= layer.height:
+ ypos_safe = layer.height - 1
+ img_idx = layer.content2D[xpos][ypos_safe]
material = self.world_map.indexed_tiles_tileset[img_idx]
idx += 1
if img_idx:
@@ -125,7 +128,7 @@ class Track():
screen.blit(screen_img, (x - cam_offset_x + offx, y - cam_offset_y + offy + horizon_y))
#num = num + 1
if material == "goals":
- surface = self.getTextSurface(xpos, ypos, img_idx)
+ surface = self.getTextSurface(xpos, ypos_safe, img_idx)
screen.blit(surface, (x - cam_offset_x + offx + 10, y - cam_offset_y + offy + horizon_y + 10))
"""