public class Spike extends Prop
| Constructor and Description |
|---|
Spike()
The default constructor
|
Spike(double x,
double y,
double w,
double h)
The general constructor that creates the spikes
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Line2D |
getContactLine()
Gets the left, slanted contact line of the spike's hitbox
|
java.awt.geom.Line2D |
getRightContactLine()
Gets the right, slanted contact line of the spike's hitbox
|
void |
interact(GameObject gameObject)
Describes the interaction between the spike and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the spike's hitbox
|
void |
update()
Empty function body becasue this function is not used
|
changeXDir, changeYDirpublic Spike()
public Spike(double x,
double y,
double w,
double h)
x - The x coordinate of the objecty - The y coordinate of the objectw - The width of the objecth - The height of the objectpublic java.awt.geom.Line2D getContactLine()
getContactLine in class Proppublic java.awt.geom.Line2D getRightContactLine()
public void paint(java.awt.Graphics g)
public void update()
public void interact(GameObject gameObject)