public class InclinePlatform extends StationaryPlatform
| Modifier and Type | Field and Description |
|---|---|
int |
xDir
The x direction the slanted platform is facing
|
degree, gravity, GRAVITY, h, TURN_ON_ANIM, w, x, y, yDir| Constructor and Description |
|---|
InclinePlatform()
The default constructor
|
InclinePlatform(double x,
double y,
double w,
double h,
int xDir)
The general constructor used to create the inclined platform
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Line2D |
getContactLine()
Gets the slanted contact line of the platforms's hitbox
|
void |
interact(GameObject gameObject)
Describes the interaction between the platform and the object it is interacting with using the angle of the slanted contact line
|
void |
paint(java.awt.Graphics g)
Draws the hitbox of the platform
|
calculateAngle, calculateT, updatechangeXDir, changeYDirpublic InclinePlatform()
public InclinePlatform(double x,
double y,
double w,
double h,
int xDir)
x - The x coordinate of the objecty - The y coordinate of the objectw - The width of the objecth - The height of the objectxDir - The x direction of the slanted linepublic java.awt.geom.Line2D getContactLine()
getContactLine in class StationaryPlatformpublic void paint(java.awt.Graphics g)
paint in class StationaryPlatformg - An instance of the Graphics objectpublic void interact(GameObject gameObject)
interact in class StationaryPlatformgameObject - The object the platform is interacting with