Star stream updates. (mad-s/opsu@701ef796)
- Make StarStream directional. - Burst stars when score rank increases.
This commit is contained in:
@@ -50,6 +50,7 @@ import itdelatrisu.opsu.replay.ReplayFrame;
|
||||
import itdelatrisu.opsu.ui.Colors;
|
||||
import itdelatrisu.opsu.ui.Fonts;
|
||||
import itdelatrisu.opsu.ui.MenuButton;
|
||||
import itdelatrisu.opsu.ui.StarStream;
|
||||
import itdelatrisu.opsu.ui.UI;
|
||||
import itdelatrisu.opsu.ui.animations.AnimationEquation;
|
||||
|
||||
@@ -277,6 +278,9 @@ public class Game extends BasicGameState {
|
||||
/** The current alpha of the scoreboard. */
|
||||
private float currentScoreboardAlpha;
|
||||
|
||||
/** The star stream shown when passing another score. */
|
||||
private StarStream scoreboardStarStream;
|
||||
|
||||
/** Music position bar background colors. */
|
||||
private static final Color
|
||||
MUSICBAR_NORMAL = new Color(12, 9, 10, 0.25f),
|
||||
@@ -314,6 +318,13 @@ public class Game extends BasicGameState {
|
||||
musicBarWidth = Math.max(width * 0.005f, 7);
|
||||
musicBarHeight = height * 0.9f;
|
||||
|
||||
// initialize scoreboard star stream
|
||||
scoreboardStarStream = new StarStream(
|
||||
0, height * 2f / 3f,
|
||||
width / 3, 0,
|
||||
height / 20, 0.2f
|
||||
);
|
||||
|
||||
// create the associated GameData object
|
||||
data = new GameData(width, height);
|
||||
}
|
||||
@@ -597,6 +608,7 @@ public class Game extends BasicGameState {
|
||||
ScoreData currentScore = data.getCurrentScoreData(beatmap, true);
|
||||
while (currentRank > 0 && previousScores[currentRank - 1].score < currentScore.score) {
|
||||
currentRank--;
|
||||
scoreboardStarStream.burst(20);
|
||||
lastRankUpdateTime = trackPosition;
|
||||
}
|
||||
|
||||
@@ -605,6 +617,9 @@ public class Game extends BasicGameState {
|
||||
);
|
||||
int scoreboardPosition = 2 * container.getHeight() / 3;
|
||||
|
||||
// draw star stream behind the scores
|
||||
scoreboardStarStream.draw();
|
||||
|
||||
if (currentRank < 4) {
|
||||
// draw the (new) top 5 ranks
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@@ -687,6 +702,7 @@ public class Game extends BasicGameState {
|
||||
playbackSpeed.getButton().hoverUpdate(delta, mouseX, mouseY);
|
||||
int trackPosition = MusicController.getPosition();
|
||||
int firstObjectTime = beatmap.objects[0].getTime();
|
||||
scoreboardStarStream.update(delta, false);
|
||||
|
||||
// returning from pause screen: must click previous mouse position
|
||||
if (pauseTime > -1) {
|
||||
|
||||
@@ -451,7 +451,11 @@ public class SongMenu extends BasicGameState {
|
||||
});
|
||||
|
||||
// star stream
|
||||
starStream = new StarStream(width, height);
|
||||
starStream = new StarStream(
|
||||
width, (height - GameImage.STAR.getImage().getHeight()) / 2,
|
||||
-width, 0,
|
||||
height / 20f, 0.1f
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -766,7 +770,7 @@ public class SongMenu extends BasicGameState {
|
||||
}
|
||||
|
||||
// star stream
|
||||
starStream.update(delta);
|
||||
starStream.update(delta, true);
|
||||
|
||||
// search
|
||||
search.setFocus(true);
|
||||
|
||||
Reference in New Issue
Block a user