Class republikensoft.Bullet
All Packages Class Hierarchy This Package Previous Next Index
Class republikensoft.Bullet
java.lang.Object
|
+----republikensoft.Moving
|
+----republikensoft.Bullet
- public class Bullet
- extends Moving
Bullet is the class that contains most hairy code since it does
some sort of collision detection.
-
maxBorderPass
- How may times a bullet can pass the vertical edges.
-
maxMilage
- How many pixels a bullet can travel, at most.
-
Bullet()
- All bullets are created by a Player.
-
draw(Graphics)
- Draws the bullet translated a couple of pixels so coord is the
centre of the bullet.
-
fire(int, int, int)
- Fires a new bullet.
-
update()
- Updates the bullet.
maxBorderPass
public final static int maxBorderPass
- How may times a bullet can pass the vertical edges.
Currently set to 2.
maxMilage
public final static int maxMilage
- How many pixels a bullet can travel, at most.
Used to prevent endless ricochet loops. Measured in Manhattan distance.
Currently set to 2000.
Bullet
public Bullet()
- All bullets are created by a Player.
- See Also:
- Player
draw
public void draw(Graphics g)
- Draws the bullet translated a couple of pixels so coord is the
centre of the bullet.
- Overrides:
- draw in class Moving
fire
public void fire(int x,
int y,
int speed)
- Fires a new bullet.
- Parameters:
- x - x-coordinate
- y - y-coordinate
- s - initial horizontal speed
update
public void update()
- Updates the bullet.
- Overrides:
- update in class Moving
All Packages Class Hierarchy This Package Previous Next Index