public class Chopper extends Unit
| Modifier and Type | Field and Description |
|---|---|
Animation |
curAnimation
The current animation
|
java.awt.image.BufferedImage |
default_image
Stores the default image
|
static java.lang.String |
DEFAULT_IMAGE_FILENAME
The filename of the default image when animations are turned off
|
boolean |
isSwimming
Identifies if the Chopper is moving
|
static int |
MAX_SWIM_UP_DELAY
The max delay of the Chopper before it moves up after reaching its lowest point
|
static double |
MAX_Y_SPEED
The max y speed of the Chopper
|
int |
swimUpDelay
Stores the delay to move up after reaching its lowest point
|
static double |
Y_ACCEL
The constant y acceleration of the Chopper as it moves up and down
|
| Constructor and Description |
|---|
Chopper()
The default constructor
|
Chopper(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 Chopper
|
| Modifier and Type | Method and Description |
|---|---|
void |
interact(GameObject gameObject)
Describes the interaction between the Chopper and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the Chopper's hitbox, animation, and default image
|
void |
update()
Updates the Choppers's animations and movement
|
void |
updateY()
Updates the y movements
|
getBottomContactLine, getBoundary, getCenterHorizontalContactLine, getCenterVerticalContactLine, getContactLine, getLeftContactLine, getRightContactLinechangeXDir, changeYDirpublic static final double MAX_Y_SPEED
public static final double Y_ACCEL
public static final int MAX_SWIM_UP_DELAY
public static final java.lang.String DEFAULT_IMAGE_FILENAME
public java.awt.image.BufferedImage default_image
public Animation curAnimation
public int swimUpDelay
public boolean isSwimming
public Chopper()
public Chopper(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()