public class Ring extends Prop
| Modifier and Type | Field and Description |
|---|---|
java.awt.image.BufferedImage |
default_image
Stores the default image
|
static java.lang.String |
DEFAULT_IMAGE_FILENAME
The filename of the default image if animations are turned off
|
Animation |
ringAnimation
The current ring animation
|
| Constructor and Description |
|---|
Ring()
The default constructor
|
Ring(double x,
double y,
double w,
double h,
ImageManager imageManager)
The general constructor used to create the ring
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Line2D |
getBottomContactLine()
Gets the bottom contact line of the ring's hitbox
|
java.awt.geom.Line2D |
getContactLine()
Gets the top contact line of the ring's hitbox
|
java.awt.geom.Line2D |
getLeftContactLine()
Gets the left contact line of the ring's hitbox
|
java.awt.geom.Line2D |
getRightContactLine()
Gets the right contact line of the ring's hitbox
|
void |
interact(GameObject gameObject)
Describes the interaction between the ring and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the ring's hitbox
|
void |
update()
Updates the animation of the rings
|
changeXDir, changeYDirpublic static final java.lang.String DEFAULT_IMAGE_FILENAME
public java.awt.image.BufferedImage default_image
public Animation ringAnimation
public Ring()
public Ring(double x,
double y,
double w,
double h,
ImageManager imageManager)
x - The x coordinate of the objecty - The y coordinate of the objectw - The width of the objecth - The height of the objectimageManager - A hashmap containing all of the sprite animationspublic java.awt.geom.Line2D getContactLine()
getContactLine in class Proppublic java.awt.geom.Line2D getRightContactLine()
public java.awt.geom.Line2D getBottomContactLine()
public java.awt.geom.Line2D getLeftContactLine()
public void paint(java.awt.Graphics g)
public void interact(GameObject gameObject)