Mercurial > skaapsteker
changeset 103:aaef228b6358
Run kitsune, run! And by the running of the kitsune gravity is restored to normal.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Mon, 04 Apr 2011 20:46:44 +0200 |
parents | 2e913a89e69d |
children | 12ce1d131a72 |
files | skaapsteker/physics.py skaapsteker/sprites/player.py |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/skaapsteker/physics.py Mon Apr 04 20:23:14 2011 +0200 +++ b/skaapsteker/physics.py Mon Apr 04 20:46:44 2011 +0200 @@ -81,7 +81,7 @@ class World(object): - GRAVITY = 9.8 * 20.0 # pixels / s^2 + GRAVITY = 0.0, 9.8 * 20.0 # pixels / s^2 def __init__(self): self._all = pygame.sprite.LayeredUpdates() @@ -139,7 +139,7 @@ self._last_time, dt = now, now - self._last_time # gravity - dv = (-self.GRAVITY * 0.5 * dt, self.GRAVITY * dt) + dv = self.GRAVITY[0] * dt, self.GRAVITY[1] * dt for sprite in self._gravitators: sprite.deltav(dv)
--- a/skaapsteker/sprites/player.py Mon Apr 04 20:23:14 2011 +0200 +++ b/skaapsteker/sprites/player.py Mon Apr 04 20:46:44 2011 +0200 @@ -43,16 +43,16 @@ self.rect = self.image.get_rect(topleft=(pos[0]*TILE_SIZE[0], pos[1]*TILE_SIZE[1])) def action_left(self): - print "L" + self.deltav((-100.0, 0.0)) def action_right(self): - print "R" + self.deltav((100.0, 0.0)) def action_up(self): - print "U" + self.deltav((0.0, -100.0)) def action_down(self): - print "D" + self.deltav((0.0, 100.0)) def action_fire1(self): print "F1"