public class EndScreen
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BUTTON_H
The height of the buttons on the screen
|
static int |
BUTTON_W
The width of the buttons on the screen
|
static int |
BUTTON_X
The x position of the buttons on the screen
|
static int |
CREDIT_OFFSET_X
The x offset for text in the end credit button
|
static int |
CREDIT_Y
The y position of the end credit button on the screen
|
Sonic |
curSonic
An instance of the Sonic class
|
static int |
END_SCREEN_DELAY
The delay length to wait before showing the ending animation
|
int |
endScreenDelay
Stores Sonic's end screen delay
|
static boolean |
finishedScoreLoading
Identifies if all of the stats in the end screen have finished animating
|
static int |
NEXT_STAGE_OFFSET_X
The x offset for text in the next stage button
|
static int |
NEXT_Y
The y position of the next stage button on the screen
|
static int |
QUIT_OFFSET_X
The x offset for text in the quit button
|
static int |
QUIT_Y
The y position of the quit button on the screen
|
static int |
RING_BONUS_Y
The y position of the ring bonus
|
int |
ringBonus
Stores Sonic's ring bonus
|
int |
ringBonusChange
Stores Sonic's ring bonus animation rate
|
int |
score
Stores Sonic's score
|
static int |
SCORE_Y
The y position of the score
|
static int |
SUBTRACTING_AMOUNT
The score subtracting amount for each frame during the ending animation
|
static int |
TEXT_OFFSET_Y
The y offset for text in the buttons
|
static int |
TIME_BONUS_Y
The y position of the time bonus
|
int |
timeBonus
Stores Sonic's time bonus
|
int |
timeBonusChange
Stores Sonic's time bonus animation rate
|
static int |
WHITE_NUMBER_X
The x positions of white text on the screen
|
static int |
YELLOW_TEXT_X
The x positions of yellow text on the screen
|
| Constructor and Description |
|---|
EndScreen()
The default constructor
|
EndScreen(GameObject sonic)
The general constructor used to create the screen
|
| Modifier and Type | Method and Description |
|---|---|
int |
calculateTimeBonus(int finalTime)
Calculating the time bonus
|
void |
paint(java.awt.Graphics g)
Drawing the UI: scores, time, and rings
|
void |
update()
Updating the score
|
public static final int SUBTRACTING_AMOUNT
public static final int END_SCREEN_DELAY
public static final int YELLOW_TEXT_X
public static final int WHITE_NUMBER_X
public static final int SCORE_Y
public static final int TIME_BONUS_Y
public static final int RING_BONUS_Y
public static final int BUTTON_W
public static final int BUTTON_H
public static final int BUTTON_X
public static final int NEXT_Y
public static final int CREDIT_Y
public static final int QUIT_Y
public static final int TEXT_OFFSET_Y
public static final int NEXT_STAGE_OFFSET_X
public static final int CREDIT_OFFSET_X
public static final int QUIT_OFFSET_X
public int score
public int timeBonus
public int timeBonusChange
public int ringBonus
public int ringBonusChange
public int endScreenDelay
public static boolean finishedScoreLoading
public Sonic curSonic
public EndScreen()
public EndScreen(GameObject sonic)
sonic - The object which the end screen will be displaying its scorespublic void paint(java.awt.Graphics g)
g - An instance of Graphics objectpublic void update()
public int calculateTimeBonus(int finalTime)
finalTime - The time right before the game ended