public class OtherSonic extends Sonic
| Modifier and Type | Field and Description |
|---|---|
boolean |
collidedWithStageFeature
Identifies if OtherSonic collided with a stage feature
|
int |
curStatus
The current status of the Ghost Recon
|
double |
dstX
The ending x position of the recovery
|
double |
dstY
The ending y position of the recovery
|
MultiplayerInfo |
finalMultiplayerInfoDuringLag
The last multiplayer info packet during a lag spike
|
static int |
GHOST_RECON_AIRBORNE
Represents the state where OtherSonic is airborne
|
static int |
GHOST_RECON_CHECKING_FOR_IDLING
Represents the state where OtherSonic is checking if the other player is idling
|
static int |
GHOST_RECON_NONE
Represents the state where Ghost Recon has not started
|
static int |
GHOST_RECON_RECOVERING_AFTER_LAG_SPIKE_WHILE_ON_GROUND
Represents the state where OtherSonic is recovering while on the ground
|
static int |
GHOST_RECON_RECOVERING_AFTER_LAG_SPIME_WHILE_AIRBORNE
Represents the state where OtherSonic is recovering while airborne
|
static int |
GHOST_RECON_RECOVERY_RATE
The rate OtherSonic recovers its x and y position
|
static int |
GHOST_RECON_START
Represents the state where Ghost Recon has started
|
static int |
GHOST_RECON_TOL_IN_MILLI
The maximum tolerable delay between sending and receiving packets in milliseconds
|
boolean |
hasFinalPacketDuringLag
Identifies if OtherSonic is using the last multiplayer info packet during lag
|
int |
intervalMultiplayerInfo
The time interval between sending and receiving a packet
|
boolean |
isAirborne
Identifies if OtherSonic is airborne
|
int |
jumpingRecoveryCount
Counts the frames in between each multiplayer info packet during airborne recovery
|
MultiplayerInfos |
multiplayerInfos
Stores OtherSonic's multiplayer infos
|
int |
nextJumpInfoSerialNum
The next serial number of the multiplayer info packet during airborne recovery
|
MultiplayerInfo |
prevMultiplayerInfo
The previous frame's multiplayer info packet
|
boolean |
startedGroundRecovery
Idenitifes if OtherSonic started recovering while on the ground
|
boolean |
startedJumpAnim
Identifies if OtherSonic started a jumping animation
|
boolean |
startedJumping
Identifies if OtherSonic started to jump
|
boolean |
startedJumpingRecoveryAnim
Identifies if OtherSonic started the jumping animation while airborne recovery
|
double |
startX
The starting x position of the recovery
|
double |
startY
The starting y position of the recovery
|
long |
timeStampMultiplayerInfoReceived
The time stamp of the last received multiplayer info packet
|
java.lang.String |
userID
The string ID of the OtherSonic
|
boolean |
waitingForOtherSonicToLand
Identifies if OtherSonic is waiting for the other player to land
|
int |
xIndex
The current index for the x recovery
|
double[] |
xRecovery
Stores all of the x positions of the recovery
|
int |
xRecoverySize
The number of x recovery positions
|
int |
yIndex
The current index for the y recovery
|
double[] |
yRecovery
Stores all of the y positions of the recovery
|
int |
yRecoverySize
The number of y recovery positions
|
BADNIK_BOUNCE_Y_SPEED, board, brokeObject, camera, checkpointFxOn, curAnimation, curStageFeature, DAMAGE_DELAY, damageDelay, default_image, DEFAULT_IMAGE_FILENAME, doneScoreLoading, drankSpeedPotion, fallingAfterJumping, fallingWithoutJumping, fromLoop2, hitBarrier, hitCeiling, imageManager, inBallForm, INC_SCORE, isThisOtherSonic, JUMP_Y_SPEED, jumpFxOn, jumping, landingOnBarrier, landOnSpikeFxOn, lastMilliSecMultiplayerInfo, lives, loseRingsFxOn, LOSING_RINGS_AMOUNT, MAX_BALL_X_SPEED, MAX_LIVES, MAX_RUNNING_X_SPEED, MAX_SKIP_COUNTER_LAG_SEND_PLAYER_INFO, MAX_SKIP_COUNTER_NON_LAG_SEND_PLAYER_INFO, MAX_Y_SPEED, MIN_SKIP_COUNTER_LAG_SEND_PLAYER_INFO, MIN_SKIP_COUNTER_NON_LAG_SEND_PLAYER_INFO, minSpeedReached, myInfosToSend, name, nextLoopId, nextSCurveId, offSpring, onBarrier, onCurved, onLoop, onSCurve, p1X, p1Y, p2X, p2Y, p3X, p3Y, p4X, p4Y, reachedTheEnd, respawnX, respawnY, rings, ringsFxOn, score, SEND_PLAYER_INFO_DELAY, serialNumMultiplayerInfo, skipCounterLagSendPlayerInfo, skipCounterNonLagSendPlayerInfo, SONIC_BALL_H, SONIC_BALL_W, SONIC_H, SONIC_W, speedPotionDelay, SPIN_BALL_DELAY, spinBallAttack, spinBallDelay, spinBallFxOn, SPRING_Y_SPEED, springFxOn, STARTING_X, STARTING_Y, takenOff, tookDamage, turnLagSendPlayerInfo| Constructor and Description |
|---|
OtherSonic()
The default constructor
|
OtherSonic(java.lang.String userID,
MultiplayerInfos multiplayerInfos,
ImageManager imageManager)
The general constructor used to create other Sonics
|
| Modifier and Type | Method and Description |
|---|---|
void |
ghostRecon()
Ghost Recon is the programs attempt to predict and fix packet loss errors from the server
|
void |
handleNewPacket()
Checks if OtherSonic started jumping or needs to recover when a new packet is received
|
void |
interpolateX()
Interpolates OtherSonic's x position
|
void |
interpolateYDuringJump()
Interpolates OtherSonic's y position while airborne
|
void |
update()
Updates OtherSonic's animations and movements
|
void |
updateCollisionDetection()
Checks if OtherSonic collided with a stage feature
|
getBottomContactLine, getContactLine, getCurrentMyInfo, getCurStageFeature, getLeftContactLine, getRightContactLine, interact, paint, respawnSonic, sendPlayerInfo, updateAnimation, updateSpinBall, updateX, updateXSpeed, updateYgetBoundary, getCenterHorizontalContactLine, getCenterVerticalContactLinechangeXDir, changeYDirpublic static final int GHOST_RECON_TOL_IN_MILLI
public static final int GHOST_RECON_NONE
public static final int GHOST_RECON_START
public static final int GHOST_RECON_RECOVERING_AFTER_LAG_SPIKE_WHILE_ON_GROUND
public static final int GHOST_RECON_AIRBORNE
public static final int GHOST_RECON_CHECKING_FOR_IDLING
public static final int GHOST_RECON_RECOVERING_AFTER_LAG_SPIME_WHILE_AIRBORNE
public static final int GHOST_RECON_RECOVERY_RATE
public java.lang.String userID
public MultiplayerInfo prevMultiplayerInfo
public int intervalMultiplayerInfo
public long timeStampMultiplayerInfoReceived
public boolean isAirborne
public boolean startedJumpAnim
public boolean startedJumping
public int curStatus
public MultiplayerInfos multiplayerInfos
public boolean startedGroundRecovery
public double startX
public double startY
public double[] xRecovery
public double[] yRecovery
public int xRecoverySize
public int yRecoverySize
public int xIndex
public int yIndex
public double dstX
public double dstY
public boolean collidedWithStageFeature
public MultiplayerInfo finalMultiplayerInfoDuringLag
public boolean hasFinalPacketDuringLag
public int nextJumpInfoSerialNum
public boolean waitingForOtherSonicToLand
public int jumpingRecoveryCount
public boolean startedJumpingRecoveryAnim
public OtherSonic()
public OtherSonic(java.lang.String userID,
MultiplayerInfos multiplayerInfos,
ImageManager imageManager)
userID - The string ID of other usersmultiplayerInfo - The multiplayer information shared between the server and the clientimageManager - A hashmap containing all of the sprite animationspublic void update()
public void handleNewPacket()
public void ghostRecon()
public void interpolateYDuringJump()
public void interpolateX()
public void updateCollisionDetection()
updateCollisionDetection in class Sonic