Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game1
diff options
context:
space:
mode:
authorMateu Batle <mateu.batle@collabora.co.uk>2010-11-15 03:00:04 (GMT)
committer Mateu Batle <mateu.batle@collabora.co.uk>2010-11-15 03:00:04 (GMT)
commit3396aade01aa9c9d22e923728f1341deb4fe7f3b (patch)
tree00532d515cdeaa8170c584ee5e27e17ee3d535fc /game1
parent383eeb4d3e48cd81be2827149e299755e5449ae9 (diff)
Fixed bug that made the game crash
Repeated last line until the end of track is reached by the player
Diffstat (limited to 'game1')
-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))
"""