Mercurial > fife-parpg
diff demos/shooter/scripts/ships/player.py @ 448:5e2ec84902a7
Did a little re-factoring.
Introduced the scene graph for collision detection.
Changed the time scale to be accurate.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 01 Apr 2010 17:03:34 +0000 |
parents | 64676ea55472 |
children | 1cf56403347a |
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/player.py Wed Mar 31 21:13:07 2010 +0000 +++ b/demos/shooter/scripts/ships/player.py Thu Apr 01 17:03:34 2010 +0000 @@ -27,8 +27,8 @@ class Player(Ship): - def __init__(self, scene, shipName, layer): - super(Player, self).__init__(scene, shipName, layer, True) + def __init__(self, model, playerName, layer): + super(Player, self).__init__(model, playerName, layer) self._bounds = Rect(-100,-100,200,200) def update(self, timedelta, keystate, camera): @@ -37,20 +37,20 @@ oldpos = self.location if keystate['UP']: - self.applyThrust(fife.DoublePoint(0,-0.075), timedelta) + self.applyThrust(fife.DoublePoint(0,-0.0075), timedelta) key = True if keystate['DOWN']: - self.applyThrust(fife.DoublePoint(0,0.075), timedelta) + self.applyThrust(fife.DoublePoint(0,0.0075), timedelta) key = True if keystate['LEFT']: - self.applyThrust(fife.DoublePoint(-0.075,0), timedelta) + self.applyThrust(fife.DoublePoint(-0.0075,0), timedelta) key = True if keystate['RIGHT']: - self.applyThrust(fife.DoublePoint(0.075,0), timedelta) + self.applyThrust(fife.DoublePoint(0.0075,0), timedelta) key = True if not key and self._velocity.length() > 0: - self.applyBrake(0.075) + self.applyBrake(0.0075, timedelta) super(Player, self).update(timedelta)