diff demos/shooter/scripts/ships/player.py @ 477:6b33d80b468b

Projectiles are now part of the scene. Cleaned up the scene update() function. Moved garbage collection to the beginning of the frame. Introduced global object types. Projectiles now only check for collisions in a limited number of scene nodes rather than the entire screen.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 22 Apr 2010 19:52:34 +0000
parents afde89c1d50b
children ab28994820dd
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/player.py	Thu Apr 22 01:18:44 2010 +0000
+++ b/demos/shooter/scripts/ships/player.py	Thu Apr 22 19:52:34 2010 +0000
@@ -22,6 +22,7 @@
 # ####################################################################
 
 from fife import fife
+from scripts.common.baseobject import *
 from scripts.ships.shipbase import *
 from scripts.common.helpers import *
 from scripts.weapons import *
@@ -43,6 +44,8 @@
 	def __init__(self, scene, playerName):
 		super(Player, self).__init__(scene, playerName)
 
+		self._type = SHTR_PLAYER
+
 		self._score = 0
 		self._maxvelocity = 1.5
 		self._acceleration = 1.0
@@ -50,8 +53,6 @@
 		self.width = 0.22
 		self.height = 0.12		
 		
-		self._isplayer = True
-		
 		self._actionlistener = PlayerActionListener(self)
 
 		self._lives = 3