# HG changeset patch # User Jeremy Thurgood # Date 1302111184 -7200 # Node ID 88a78fb9fa82f25101ddeb4574489963d84efb25 # Parent 57a78f19c6737977cedb13cd9400736f510e55e6 Tweak some constants to make player motion more comfortable. diff -r 57a78f19c673 -r 88a78fb9fa82 skaapsteker/physics.py --- a/skaapsteker/physics.py Wed Apr 06 19:24:09 2011 +0200 +++ b/skaapsteker/physics.py Wed Apr 06 19:33:04 2011 +0200 @@ -18,7 +18,7 @@ # physics attributes mobile = True # whether the velocity may be non-zero gravitates = True # whether gravity applies to the sprite - terminal_velocity = (450.0, 450.0) # maximum horizontal and vertial speeds (pixels / s) + terminal_velocity = (450.0, 500.0) # maximum horizontal and vertial speeds (pixels / s) bounce_factor = (0.95, 0.95) # bounce factor mass = 1.0 # used for shared collisions and applying forces friction_coeff = (0.99, 0.99) # friction factor @@ -166,7 +166,7 @@ class World(object): - GRAVITY = 0.0, 9.8 * 20.0 # pixels / s^2 + GRAVITY = 0.0, 9.8 * 80.0 # pixels / s^2 def __init__(self): self._all = pygame.sprite.LayeredUpdates() diff -r 57a78f19c673 -r 88a78fb9fa82 skaapsteker/sprites/player.py --- a/skaapsteker/sprites/player.py Wed Apr 06 19:24:09 2011 +0200 +++ b/skaapsteker/sprites/player.py Wed Apr 06 19:33:04 2011 +0200 @@ -69,12 +69,12 @@ time_diff = time.time() - self._last_time if int(self._animation_frame) - int(old_frame) > 0: # Check time diff - if time_diff < 0.07: + if time_diff < 0.10: # Delay animation frame jump self._animation_frame -= abs(v_x) / 300 else: self._last_time = time.time() - elif time_diff > 0.15: + elif time_diff > 0.20: # Force animation frame jump self._animation_frame = old_frame + 1 self._last_time = time.time() @@ -102,17 +102,17 @@ if self.facing != 'left': self.facing = 'left' self.set_image() - self.deltav((-300.0, 0.0)) + self.deltav((-450.0, 0.0)) def action_right(self): if self.facing != 'right': self.facing = 'right' self.set_image() - self.deltav((300.0, 0.0)) + self.deltav((450.0, 0.0)) def action_up(self): if self.on_solid: - self.deltav((0.0, -350.0)) + self.deltav((0.0, -self.terminal_velocity[1])) self.on_solid = False def action_down(self):