Skip to content

Commit 3e4c97b

Browse files
Implemented ts (this)
1 parent 737a1c2 commit 3e4c97b

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

source/funkin/game/PlayState.hx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ class PlayState extends MusicBeatState
359359
* Camera zoom at which the game lerps to.
360360
*/
361361
public var defaultCamZoom:Float = 1.05;
362+
/**
363+
* Camera angle at which the game lerps to.
364+
*/
365+
public var defaultCamAngle:Float = 0;
362366
/**
363367
* Speed at which the game camera zoom lerps to.
364368
*/
@@ -368,6 +372,10 @@ class PlayState extends MusicBeatState
368372
* Camera zoom at which the hud lerps to.
369373
*/
370374
public var defaultHudZoom:Float = 1.0;
375+
/**
376+
* Camera angle at which the hud lerps to.
377+
*/
378+
public var defaultHudAngle:Float = 0;
371379
/**
372380
* Speed at which the hud camera zoom lerps to.
373381
*/
@@ -720,7 +728,9 @@ class PlayState extends MusicBeatState
720728

721729
FlxG.camera.follow(camFollow, LOCKON, 0.04);
722730
FlxG.camera.zoom = defaultCamZoom;
731+
FlxG.camera.angle = defaultCamAngle;
723732
// camHUD.zoom = defaultHudZoom;
733+
// camHUD.angle = defaultHudAngle;
724734

725735
if (smoothTransitionData != null && smoothTransitionData.stage == curStage) {
726736
FlxG.camera.scroll.set(smoothTransitionData.camX, smoothTransitionData.camY);
@@ -1327,7 +1337,9 @@ class PlayState extends MusicBeatState
13271337
if (camZooming)
13281338
{
13291339
FlxG.camera.zoom = lerp(FlxG.camera.zoom, defaultCamZoom, camGameZoomLerp);
1340+
FlxG.camera.angle = lerp(FlxG.camera.angle, defaultCamAngle, camGameAngleLerp);
13301341
camHUD.zoom = lerp(camHUD.zoom, defaultHudZoom, camHUDZoomLerp);
1342+
camHUD.angle = lerp(camHUD.angle, defaultHudAngle, camHUDAngleLerp);
13311343
}
13321344

13331345
// RESET = Quick Game Over Screen
@@ -1393,8 +1405,9 @@ class PlayState extends MusicBeatState
13931405
case "Camera Movement":
13941406
curCameraTarget = event.params[0];
13951407
case "Add Camera Zoom":
1396-
var camera:FlxCamera = event.params[1] == "camHUD" ? camHUD : camGame;
1408+
var camera:FlxCamera = event.params[2] == "camHUD" ? camHUD : camGame;
13971409
camera.zoom += event.params[0];
1410+
camera.angle + event.params[1];
13981411
case "Camera Modulo Change":
13991412
camZoomingInterval = event.params[0];
14001413
camZoomingStrength = event.params[1];
@@ -1825,6 +1838,13 @@ class PlayState extends MusicBeatState
18251838
override function stepHit(curStep:Int)
18261839
{
18271840
super.stepHit(curStep);
1841+
1842+
if (Options.camZoomOnBeat && camZooming && FlxG.camera.zoom < maxCamZoom && (curStep / 4) % camZoomingInterval == 0)
1843+
{
1844+
FlxG.camera.zoom += 0.015 * camZoomingStrength;
1845+
camHUD.zoom += 0.03 * camZoomingStrength;
1846+
}
1847+
18281848
scripts.call("stepHit", [curStep]);
18291849
}
18301850

@@ -1841,11 +1861,6 @@ class PlayState extends MusicBeatState
18411861
super.beatHit(curBeat);
18421862

18431863
if (camZoomingInterval < 1) camZoomingInterval = 1;
1844-
if (Options.camZoomOnBeat && camZooming && FlxG.camera.zoom < maxCamZoom && curBeat % camZoomingInterval == 0)
1845-
{
1846-
FlxG.camera.zoom += 0.015 * camZoomingStrength;
1847-
camHUD.zoom += 0.03 * camZoomingStrength;
1848-
}
18491864

18501865
if (doIconBop)
18511866
for (icon in [iconP1, iconP2])

0 commit comments

Comments
 (0)