public class LoopPlatform extends StationaryPlatform
| Modifier and Type | Field and Description |
|---|---|
FakeImages |
fakeOverpass
The object of the overpass image
|
static double[] |
LOOP_X1
Predetermined x coordinates of Bezier Curve controls points for loop section 1
|
static double[] |
LOOP_X2
Predetermined x coordinates of Bezier Curve controls points for loop section 2
|
static double[] |
LOOP_X3
Predetermined x coordinates of Bezier Curve controls points for loop section 3
|
static double[] |
LOOP_X4
Predetermined x coordinates of Bezier Curve controls points for loop section 4
|
int |
loopId
Stores the ID of the loop segment
|
double[] |
loopX1
Stores x coordinates of Bezier Curve control points for loop section 1
|
double[] |
loopX2
Stores x coordinates of Bezier Curve control points for loop section 2
|
double[] |
loopX3
Stores x coordinates of Bezier Curve control points for loop section 3
|
double[] |
loopX4
Stores x coordinates of Bezier Curve control points for loop section 4
|
double[] |
loopY1
Stores y coordinates of Bezier Curve control points for loop section 1
|
double[] |
loopY2
Stores y coordinates of Bezier Curve control points for loop section 2
|
double[] |
loopY3
Stores y coordinates of Bezier Curve control points for loop section 3
|
double[] |
loopY4
Stores y coordinates of Bezier Curve control points for loop section 4
|
static double |
MIN_X_SPEED
The minimum x speed Sonic must have in order to go through the loop-the-loop
|
Section |
section
Stores the map section the loop-the-loop is located in
|
| Constructor and Description |
|---|
LoopPlatform()
The default constructor
|
LoopPlatform(double x,
double y,
double w,
double h,
Section section,
int xDir)
The general constructor used to create the loop-the-loop
|
| Modifier and Type | Method and Description |
|---|---|
void |
findControlPoints()
Giving each loop segment an Id and offsetting the x coordiantes of the control points depending on the section
|
java.awt.geom.Line2D |
getBottomContactLine()
Gets the bottom contact line of the loop's reference block's hitbox
|
java.awt.geom.Line2D |
getContactLine()
Gets the top contact line of the loop's reference block's hitbox
|
java.awt.geom.Line2D |
getLeftContactLine()
Gets the left contact line of the loop's reference block's hitbox
|
double[] |
getLoopX()
Gets the the array storing the x coordinates of the control points of a curve
|
double[] |
getLoopY()
Gets the the array storing the y coordinates of the control points of a curve
|
double |
getLoopYBase(Unit gameObject)
Gets the y coordinate of the first loop segment where the gameObject's x coordinate is located
|
java.awt.geom.Line2D |
getRightContactLine()
Gets the right contact line of the loop's reference block's hitbox
|
void |
interact(GameObject gameObject)
Describes the interaction between the loop and the object it is interacting with
|
void |
paint(java.awt.Graphics g)
Draws the Bezier curve of the loop's segment
|
calculateAngle, calculateT, updatechangeXDir, changeYDirpublic static final double MIN_X_SPEED
public static final double[] LOOP_X1
public static final double[] LOOP_X2
public static final double[] LOOP_X3
public static final double[] LOOP_X4
public double[] loopX1
public double[] loopY1
public double[] loopX2
public double[] loopY2
public double[] loopX3
public double[] loopY3
public double[] loopX4
public double[] loopY4
public Section section
public FakeImages fakeOverpass
public int loopId
public LoopPlatform()
public LoopPlatform(double x,
double y,
double w,
double h,
Section section,
int xDir)
x - The x coordinate of the reference blocky - The y coordinate of the reference blockw - The width of the reference blockh - The height of the reference blocksection - The map section the loop is located inxDir - The x direction of the curvepublic double[] getLoopX()
public double[] getLoopY()
public double getLoopYBase(Unit gameObject)
gameObject - The object the curve is using to find the y coordinate of the curve depending on the x value of the game objectpublic java.awt.geom.Line2D getContactLine()
getContactLine in class StationaryPlatformpublic java.awt.geom.Line2D getRightContactLine()
public java.awt.geom.Line2D getBottomContactLine()
public java.awt.geom.Line2D getLeftContactLine()
public 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 loop is interacting withpublic void findControlPoints()