More star stream tweaks.

- Pass in the max stars in the stream, excluding bursts. (Use 0 for burst-only star streams.)
- Added duration spread setters. (Scoreboard star stream burst now happens faster.)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2016-12-23 01:29:49 -05:00
parent 2d7a4a3eab
commit 106891a259
3 changed files with 57 additions and 35 deletions

View File

@@ -319,11 +319,10 @@ public class Game extends BasicGameState {
musicBarHeight = height * 0.9f;
// initialize scoreboard star stream
scoreboardStarStream = new StarStream(
0, height * 2f / 3f,
width / 3, 0,
height / 20, 0.2f
);
scoreboardStarStream = new StarStream(0, height * 2f / 3f, width / 4, 0, 0);
scoreboardStarStream.setPositionSpread(height / 20f);
scoreboardStarStream.setDirectionSpread(10f);
scoreboardStarStream.setDurationSpread(700, 100);
// create the associated GameData object
data = new GameData(width, height);
@@ -702,7 +701,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);
scoreboardStarStream.update(delta);
// returning from pause screen: must click previous mouse position
if (pauseTime > -1) {

View File

@@ -314,6 +314,9 @@ public class SongMenu extends BasicGameState {
/** The star stream. */
private StarStream starStream;
/** The maximum number of stars in the star stream. */
private static final int MAX_STREAM_STARS = 20;
/** Whether the menu is currently scrolling to the focus node (blocks other actions). */
private boolean isScrollingToFocusNode = false;
@@ -451,11 +454,9 @@ public class SongMenu extends BasicGameState {
});
// star stream
starStream = new StarStream(
width, (height - GameImage.STAR.getImage().getHeight()) / 2,
-width, 0,
height / 20f, 0.1f
);
starStream = new StarStream(width, (height - GameImage.STAR.getImage().getHeight()) / 2, -width, 0, MAX_STREAM_STARS);
starStream.setPositionSpread(height / 20f);
starStream.setDirectionSpread(10f);
}
@Override
@@ -770,7 +771,7 @@ public class SongMenu extends BasicGameState {
}
// star stream
starStream.update(delta, true);
starStream.update(delta);
// search
search.setFocus(true);