Skip to content

Commit

Permalink
Fix bug where you could fall through the ground under scary circumsta…
Browse files Browse the repository at this point in the history
…nces.

That's the last bug, guys! With 13 minutes to go, too. Guess I
should have added a few more features. :)
  • Loading branch information
Grant Mathews committed Aug 22, 2011
1 parent 7d5e2fd commit 9fd2ea9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,10 @@ def __init__(self, x, y):
self.restore_y = self.y

self.vx = 0
self.vy = 0
if DEBUG:
self.vy = 20
else:
self.vy = 0

if DEBUG:
self.health = 1
Expand Down Expand Up @@ -439,7 +442,7 @@ def update(self, keys, game_map, game):
self.vy = -self.jump_height

# A bit of a hack to correct for speedy falling (where you fall through blocks).
if self.vy > TILE_SIZE: self.vy = TILE_SIZE * sign(self.vy)
if self.vy > TILE_SIZE - 1: self.vy = TILE_SIZE * sign(self.vy) - 1

dx = (keys[pygame.K_RIGHT] - keys[pygame.K_LEFT]) * self.speed + self.vx
dy = + self.vy
Expand Down Expand Up @@ -1337,14 +1340,14 @@ def __init__(self):
TileSheet.add("particle.png")

if DEBUG:
self.char = Character(160, 40)
self.char = Character(120, 40)
else:
self.char = Character(40, 40)

Dialog.begin(self)

if DEBUG:
self.map = Map("map.png", [4, 1], self.char, self)
self.map = Map("map.png", [2, 1], self.char, self)
self.state = States.Normal
else:
self.map = Map("map.png", [0, 0], self.char, self)
Expand Down
Binary file modified map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9fd2ea9

Please sign in to comment.