public class SCurvePlatform extends StationaryPlatform
| Modifier and Type | Field and Description |
|---|---|
static double |
MAX_S_CURVE_X_SPEED
The max x speed Sonic can have while in the S-Curves
|
double |
referenceH
Stores the height of the firstreference block
|
double |
referencePosX
Stores the x coordinate of the first reference block
|
double |
referencePosY
Stores the y coordinate of the first reference block
|
double |
referenceW
Stores the width of the first reference block
|
static double[] |
S_CURVE_X1
Predetermined x coordinates of Bezier Curve controls points for S-Curve 1
|
static double[] |
S_CURVE_X2
Predetermined x coordinates of Bezier Curve controls points for S-Curve 2
|
static double[] |
S_CURVE_X3
Predetermined x coordinates of Bezier Curve controls points for S-Curve 3
|
static double[] |
S_CURVE_X4
Predetermined x coordinates of Bezier Curve controls points for S-Curve 4
|
static double[] |
S_CURVE_Y1
Predetermined y coordinates of Bezier Curve controls points for S-Curve 1
|
static double[] |
S_CURVE_Y2
Predetermined y coordinates of Bezier Curve controls points for S-Curve 2
|
static double[] |
S_CURVE_Y3
Predetermined y coordinates of Bezier Curve controls points for S-Curve 3
|
static double[] |
S_CURVE_Y4
Predetermined y coordinates of Bezier Curve controls points for S-Curve 4
|
int |
sCurveId
The ID of the S-Curve segment
|
double[] |
sCurveX1
Stores x coordinates of Bezier Curve control points for S-Curve 1
|
double[] |
sCurveX2
Stores x coordinates of Bezier Curve control points for S-Curve 2
|
double[] |
sCurveX3
Stores x coordinates of Bezier Curve control points for S-Curve 3
|
double[] |
sCurveX4
Stores x coordinates of Bezier Curve control points for S-Curve 4
|
double[] |
sCurveY1
Stores y coordinates of Bezier Curve control points for S-Curve 1
|
double[] |
sCurveY2
Stores y coordinates of Bezier Curve control points for S-Curve 2
|
double[] |
sCurveY3
Stores y coordinates of Bezier Curve control points for S-Curve 3
|
double[] |
sCurveY4
Stores y coordinates of Bezier Curve control points for S-Curve 4
|
Section |
section
The map section the S-Curve is located in
|
int |
startingSCurveId
The ID the first S-Curve segment
|
| Constructor and Description |
|---|
SCurvePlatform()
The default constructor
|
SCurvePlatform(double x,
double y,
double w,
double h,
Section section,
double referencePosX,
double referencePosY,
double referenceW,
double referenceH,
int xDir)
The general constructor used to create the S-Curve
|
| Modifier and Type | Method and Description |
|---|---|
void |
findControlPoints()
Giving each curve an Id and offsetting the x and y coordiantes of the control points depending on the section and first reference block
|
java.awt.geom.Line2D |
getContactLine()
Gets the left contact line of the reference block's hitbox
|
double[] |
getSCurveX()
Gets the the array storing the x coordinates of the control points of a curve
|
double[] |
getSCurveY()
Gets the the array storing the y coordinates of the control points of a curve
|
void |
interact(GameObject gameObject)
Describes the interaction between the S-Curve and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the Bezier curve
|
calculateAngle, calculateT, updatechangeXDir, changeYDirpublic static final double MAX_S_CURVE_X_SPEED
public static final double[] S_CURVE_X1
public static final double[] S_CURVE_Y1
public static final double[] S_CURVE_X2
public static final double[] S_CURVE_Y2
public static final double[] S_CURVE_X3
public static final double[] S_CURVE_Y3
public static final double[] S_CURVE_X4
public static final double[] S_CURVE_Y4
public double[] sCurveX1
public double[] sCurveY1
public double[] sCurveX2
public double[] sCurveY2
public double[] sCurveX3
public double[] sCurveY3
public double[] sCurveX4
public double[] sCurveY4
public Section section
public int sCurveId
public int startingSCurveId
public double referencePosX
public double referencePosY
public double referenceW
public double referenceH
public SCurvePlatform()
public SCurvePlatform(double x,
double y,
double w,
double h,
Section section,
double referencePosX,
double referencePosY,
double referenceW,
double referenceH,
int xDir)
x - The x coordinate of the current reference blocky - The y coordinate of the current reference blockw - The width of the current reference blockh - The height of the current reference blocksection - The section the S-Curve is located inreferencePosX - The x coordinate of the first reference blockreferencePosY - The y coordinate of the firstreference blockreferenceW - The width of the first reference blockreferenceH - The height of the first reference blockxDir - public double[] getSCurveX()
public double[] getSCurveY()
public 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 S-Curve is interacting withpublic void findControlPoints()