All Packages Class Hierarchy This Package Previous Next Index
Class com.loki3.cyber.pawn.WeaponTurret
java.lang.Object
|
+----com.loki3.pa.Item
|
+----com.loki3.cyber.pawn.UnitClass
|
+----com.loki3.cyber.pawn.Weapon
|
+----com.loki3.cyber.pawn.WeaponTurret
- public class WeaponTurret
- extends Weapon
A weapon which can turn and fire
-
WeaponTurret()
-
-
fire()
- Fire the weapon.
-
getCurrentAngle()
- Get current angle turret is facing relative to the tank in radians counterclockwise.
-
getMaker()
- object which can publicly create us
-
setParticle(Particle)
-
-
turnLeft(double)
- Change direction turret is pointing in by turning left by the given angle.
-
turnRight(double)
- Change direction turret is pointing in by turning right by the given angle.
WeaponTurret
public WeaponTurret()
getMaker
public static java.lang.Object getMaker()
object which can publicly create us
setParticle
public void setParticle(com.loki3.pa.Particle particle)
- Overrides:
- setParticle in class com.loki3.pa.Item
fire
public boolean fire()
Fire the weapon.
- Returns:
- false if the weapon can't be fired
- Overrides:
- fire in class Weapon
getCurrentAngle
public double getCurrentAngle()
Get current angle turret is facing relative to the tank in radians counterclockwise.
Useful for figuring out how much further to turn the turret.
turnLeft
public boolean turnLeft(double angle)
Change direction turret is pointing in by turning left by the given angle.
Note it may take awhile for turret to turn in given direction
- Parameters:
angle
- angle in radians
- Returns:
- turret if particle cannot turn in desired direction
turnRight
public boolean turnRight(double angle)
Change direction turret is pointing in by turning right by the given angle.
Note it may take awhile for turret to turn in given direction
- Parameters:
angle
- angle in radians
- Returns:
- false if turret cannot turn in desired direction
All Packages Class Hierarchy This Package Previous Next Index