Mercurial > fife-parpg
diff demos/shooter/scripts/weapons.py @ 490:939a4dc12ca1
Starting to add some comments.
Cleaned up some old commented out code.
The SoundManager now creates a new SoundClip rather than only creating one per FIFE SoundEmitter.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 05 May 2010 21:39:31 +0000 |
parents | 82d44c471959 |
children | c4168eb47a44 |
line wrap: on
line diff
--- a/demos/shooter/scripts/weapons.py Wed May 05 14:29:37 2010 +0000 +++ b/demos/shooter/scripts/weapons.py Wed May 05 21:39:31 2010 +0000 @@ -27,6 +27,13 @@ from scripts.soundmanager import * class Projectile(SpaceObject): + """ + Projectile + + This is the entity that weapons fire. Projectiles have an owner + and a time to live. They are also what cause damage to ships + and other entities. + """ def __init__(self, scene, owner, projectileName, timeToLive): super(Projectile, self).__init__(scene, projectileName, False) @@ -85,6 +92,14 @@ damage = property(_getDamage, _setDamage) class Weapon(object): + """ + Weapon + + This class is a super class and is meant to be inherited and + not used directly. You should implement fire() in the sub- + class. The Weapon class spawns Projectile(s) and fires them + in the specified direction at a specified fire rate. + """ def __init__(self, scene, ship, firerate): self._scene = scene self._model = self._scene.model