comparison demos/shooter/scripts/ships/player.py @ 449:1cf56403347a

Added object bounding boxes. Collision detection now works.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 01 Apr 2010 18:44:01 +0000
parents 5e2ec84902a7
children ba6817013343
comparison
equal deleted inserted replaced
448:5e2ec84902a7 449:1cf56403347a
35 key = False 35 key = False
36 36
37 oldpos = self.location 37 oldpos = self.location
38 38
39 if keystate['UP']: 39 if keystate['UP']:
40 self.applyThrust(fife.DoublePoint(0,-0.0075), timedelta) 40 self.applyThrust(fife.DoublePoint(0,-0.075), timedelta)
41 key = True 41 key = True
42 if keystate['DOWN']: 42 if keystate['DOWN']:
43 self.applyThrust(fife.DoublePoint(0,0.0075), timedelta) 43 self.applyThrust(fife.DoublePoint(0,0.075), timedelta)
44 key = True 44 key = True
45 if keystate['LEFT']: 45 if keystate['LEFT']:
46 self.applyThrust(fife.DoublePoint(-0.0075,0), timedelta) 46 self.applyThrust(fife.DoublePoint(-0.075,0), timedelta)
47 key = True 47 key = True
48 if keystate['RIGHT']: 48 if keystate['RIGHT']:
49 self.applyThrust(fife.DoublePoint(0.0075,0), timedelta) 49 self.applyThrust(fife.DoublePoint(0.075,0), timedelta)
50 key = True 50 key = True
51 51
52 if not key and self._velocity.length() > 0: 52 if not key and self._velocity.length() > 0:
53 self.applyBrake(0.0075, timedelta) 53 self.applyBrake(0.075, timedelta)
54 54
55 super(Player, self).update(timedelta) 55 super(Player, self).update(timedelta)
56 56
57 #set up the players camera bounds 57 #set up the players camera bounds
58 #TODO: grab screen resolution from somewhere 58 #TODO: grab screen resolution from somewhere