Allow skipping the video after holding the screen for 1.5 seconds with touch

This commit is contained in:
KarimAkra
2025-04-16 15:56:44 +03:00
parent a2c2b8d9dd
commit a4207c1020
+5 -8
View File
@@ -86,12 +86,8 @@ class AttractState extends MusicBeatState
});
add(vid);
if (vid.load(filePath))
{
vid.play();
vid.updateHitbox();
vid.screenCenter();
}
if (vid.load(filePath)) vid.play();
}
else
{
@@ -104,8 +100,9 @@ class AttractState extends MusicBeatState
{
super.update(elapsed);
// If the user presses any button or holds the screen for 0.8 seconds, skip the video.
if ((FlxG.keys.justPressed.ANY && !controls.VOLUME_MUTE && !controls.VOLUME_UP && !controls.VOLUME_DOWN))
// If the user presses any button or hold their screen for 1.5 seconds, skip the video.
if ((FlxG.keys.justPressed.ANY && !controls.VOLUME_MUTE && !controls.VOLUME_UP && !controls.VOLUME_DOWN) #if TOUCH_CONTROLS
|| funkin.util.TouchUtil.touch.ticksDeltaSincePress >= 1500 #end)
{
onAttractEnd();
}