public class Motorbug extends Unit
| Modifier and Type | Field and Description |
|---|---|
Animation |
curAnimation
Stores the current animations
|
java.awt.image.BufferedImage |
default_image
Stores the default iamge
|
java.lang.String |
DEFAULT_IMAGE_FILENAME
The filename of the default image if animations are turned off
|
static double |
MAX_X_RANGE
The max x range the Motorbug can travel from its original x position
|
double |
maxXRange
Stores the max x range
|
double |
originalX
Stores the original x coordinate when the Motorbug spawns
|
static double |
X_SPEED
The constant x speed of the Motorbug
|
| Constructor and Description |
|---|
Motorbug()
The default constructor
|
Motorbug(double x,
double y,
int xDir,
int yDir,
double xSpeed,
double ySpeed,
double w,
double h,
ImageManager imageManager)
The general constructor used to create the Motorbug
|
| Modifier and Type | Method and Description |
|---|---|
void |
interact(GameObject gameObject)
Describes the interaction between the Motorbug and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the Motorbug's hitbox, animation, and default image
|
void |
update()
Updates the Motorbug's movements, collision detection, and animations
|
void |
updateCollisionDetection()
Updates the Motorbug's collision detection to allow the Motorbug to move from 1 stage feature to another
|
void |
updateX()
Updates the Motorbug's x movements
|
void |
updateY()
Updates the Motorbug's y movements
|
getBottomContactLine, getBoundary, getCenterHorizontalContactLine, getCenterVerticalContactLine, getContactLine, getLeftContactLine, getRightContactLinechangeXDir, changeYDirpublic static final double MAX_X_RANGE
public static final double X_SPEED
public final java.lang.String DEFAULT_IMAGE_FILENAME
public java.awt.image.BufferedImage default_image
public Animation curAnimation
public double maxXRange
public double originalX
public Motorbug()
public Motorbug(double x,
double y,
int xDir,
int yDir,
double xSpeed,
double ySpeed,
double w,
double h,
ImageManager imageManager)
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 heightimageManager - A hashmap containing all of the sprite animationspublic void paint(java.awt.Graphics g)
public void update()
public void interact(GameObject gameObject)
public void updateY()
public void updateX()
public void updateCollisionDetection()