public class BuzzbomberBomb extends Unit
| Modifier and Type | Field and Description |
|---|---|
static double |
BOMB_H
The height of the bomb
|
static double |
BOMB_W
The width of the bomb
|
static double |
BOMB_Y_RANGE
The max y range the bomb can travel from its spawning position
|
boolean |
fired
Identifies if the bomb has been fired
|
java.awt.image.BufferedImage |
image
Stores the image of the bomb
|
static java.lang.String |
IMAGE_FILENAME
The filename of the image representing the bomb
|
static double |
X_SPEED
The constant x speed of the bomb
|
static double |
Y_SPEED
The constant y speed of the bomb
|
| Constructor and Description |
|---|
BuzzbomberBomb()
The default constructor
|
BuzzbomberBomb(double x,
double y,
int xDir,
int yDir,
double xSpeed,
double ySpeed,
double w,
double h,
Buzzbomber buzzbomber)
The general constructor used to create the bomb
|
| Modifier and Type | Method and Description |
|---|---|
void |
interact(GameObject gameObject)
Describes the interaction between the bomb and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the hitbox and the image of the bomb
|
void |
update()
Updates the movements of the bomb
|
getBottomContactLine, getBoundary, getCenterHorizontalContactLine, getCenterVerticalContactLine, getContactLine, getLeftContactLine, getRightContactLinechangeXDir, changeYDirpublic static final double X_SPEED
public static final double Y_SPEED
public static final double BOMB_W
public static final double BOMB_H
public static final double BOMB_Y_RANGE
public static final java.lang.String IMAGE_FILENAME
public java.awt.image.BufferedImage image
public boolean fired
public BuzzbomberBomb()
public BuzzbomberBomb(double x,
double y,
int xDir,
int yDir,
double xSpeed,
double ySpeed,
double w,
double h,
Buzzbomber buzzbomber)
x - The spawning x coordiantey - The spawning y coordinatexDir - The spawning xDiryDir - The spawning yDirxSpeed - The spawning xSpeedySpeed - the Spawning ySpeedw - The spawning widthh - The spawning heightbuzzbomber - The Buzzbomber the bomb belongs topublic void paint(java.awt.Graphics g)
public void interact(GameObject gameObject)