public abstract class StationaryPlatform extends StageFeature
| Constructor and Description |
|---|
StationaryPlatform()
The default constructor
|
StationaryPlatform(double x,
double y,
double w,
double h,
int xDir,
int yDir)
The general constructor used to create the stationary stage features
|
| Modifier and Type | Method and Description |
|---|---|
double |
calculateAngle(double bezierT,
double[] curveX,
double[] curveY)
Calculates the angle of the slope of a Bezier curve at a certain point
|
double |
calculateT(GameObject gameObject,
double[] curveX,
int xDir)
Calculates the value of 't' in a Bezier curve
't' is the independent variable of the Bezier curve equation that ranges from 0-1
|
abstract java.awt.geom.Line2D |
getContactLine()
Represents a collision detection line for the platform
|
abstract void |
interact(GameObject gameObject)
Describes the interation between the platform and a game object
|
abstract void |
paint(java.awt.Graphics g)
Paints the platform
|
void |
update()
Updates the platform
|
changeXDir, changeYDirpublic StationaryPlatform()
public StationaryPlatform(double x,
double y,
double w,
double h,
int xDir,
int yDir)
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 objectyDir - The y direction of the objectpublic abstract java.awt.geom.Line2D getContactLine()
getContactLine in class StageFeaturepublic abstract void paint(java.awt.Graphics g)
paint in class StageFeatureg - An instance of the Graphics objectpublic void update()
update in class StageFeaturepublic abstract void interact(GameObject gameObject)
interact in class StageFeaturegameObject - The game object that the platform is interacting withpublic double calculateT(GameObject gameObject, double[] curveX, int xDir)
gameObject - The object interacting with the Bezier curvecurveX - The array storing the x coordinates of the control points of a bezier curve Sonic is interacting withxDir - The x direction of the curvepublic double calculateAngle(double bezierT,
double[] curveX,
double[] curveY)
bezierT - The current 't' value of the Bezier curvecurveX - The array storing the x coordinates of the control points of a bezier curvecurveY - The array storing the y coordinates of the control points of a bezier curve