Skip to content

Commit

Permalink
Update CreditsState.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
JVNpixels authored Jun 27, 2024
1 parent 9bd09e3 commit 979b27c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions source/funkin/ui/credits/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ class CreditsState extends MusicBeatState
static final CREDITS_SCROLL_BASE_SPEED = 100.0;

/**
* The speed the credits scroll at while the button is held, in pixels per second.
* The speed the credits scroll at while accept keybind or spacebar is held, in pixels per second.
*/
static final CREDITS_SCROLL_FAST_SPEED = CREDITS_SCROLL_BASE_SPEED * 4.0;

/**
* The speed the credits scroll at while the pause keybind is held, in pixels per second.
*/
static final CREDITS_SCROLL_PAUSE_SPEED = 0.0;

/**
* The actual sprites and text used to display the credits.
*/
Expand Down Expand Up @@ -173,24 +178,24 @@ class CreditsState extends MusicBeatState
// TODO: Replace with whatever the special note button is.
if (controls.ACCEPT || FlxG.keys.pressed.SPACE)
{
// Move the whole group.
// Move the whole group by the base scroll speed.
creditsGroup.y -= CREDITS_SCROLL_FAST_SPEED * elapsed;
}
else if (controls.PAUSE || FlxG.keys.pressed.SHIFT)
{
// Stop the whole group from moving.
creditsGroup.y -= CREDITS_SCROLL_PAUSE_SPEED * elapsed;
}
else
{
// Move the whole group.
// Move the whole group by the base scroll speed.
creditsGroup.y -= CREDITS_SCROLL_BASE_SPEED * elapsed;
}
}

if (controls.BACK || hasEnded())
{
exit();
}
else if (controls.PAUSE)
{
// scrollPaused = !scrollPaused;
}
}

function hasEnded():Bool
Expand Down

0 comments on commit 979b27c

Please sign in to comment.