public class Spring extends Prop
| Constructor and Description |
|---|
Spring()
The default constructor
|
Spring(double x,
double y,
double w,
double h)
The general constructor used to create the spring
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Line2D |
getContactLine()
Gets the top contact line of the spring's hitbox
|
void |
interact(GameObject gameObject)
Describes the interaction between the spring and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the spring's hitbox
|
void |
update()
Empty function body becasue this function is not used
|
changeXDir, changeYDirpublic Spring()
public Spring(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 void paint(java.awt.Graphics g)
public void update()
public void interact(GameObject gameObject)