1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-10 23:46:13 +00:00

Merge pull request #192 from FunkinCrew/rewrite/bugfix/bf-pixel-cam

Fix BF Pixel death camera
This commit is contained in:
Cameron Taylor 2023-10-17 22:05:00 -04:00 committed by GitHub
commit f14afc4606
5 changed files with 25 additions and 3 deletions

2
assets

@ -1 +1 @@
Subproject commit c86e6ba78e80a0fb7514ba2d662b6fd00d327a74 Subproject commit 8eb0b74b4149190f32f8bfab38bfdefa709b849d

View file

@ -102,6 +102,9 @@ class GameOverSubState extends MusicBeatSubState
cameraFollowPoint = new FlxObject(PlayState.instance.cameraFollowPoint.x, PlayState.instance.cameraFollowPoint.y, 1, 1); cameraFollowPoint = new FlxObject(PlayState.instance.cameraFollowPoint.x, PlayState.instance.cameraFollowPoint.y, 1, 1);
cameraFollowPoint.x = boyfriend.getGraphicMidpoint().x; cameraFollowPoint.x = boyfriend.getGraphicMidpoint().x;
cameraFollowPoint.y = boyfriend.getGraphicMidpoint().y; cameraFollowPoint.y = boyfriend.getGraphicMidpoint().y;
var offsets:Array<Float> = boyfriend.getDeathCameraOffsets();
cameraFollowPoint.x += offsets[0];
cameraFollowPoint.y += offsets[1];
add(cameraFollowPoint); add(cameraFollowPoint);
FlxG.camera.target = null; FlxG.camera.target = null;

View file

@ -1641,7 +1641,7 @@ class PlayState extends MusicBeatSubState
*/ */
function onConversationComplete():Void function onConversationComplete():Void
{ {
isInCutscene = true; isInCutscene = false;
remove(currentConversation); remove(currentConversation);
currentConversation = null; currentConversation = null;

View file

@ -188,6 +188,11 @@ class BaseCharacter extends Bopper
shouldBop = false; shouldBop = false;
} }
public function getDeathCameraOffsets():Array<Float>
{
return _data.death?.cameraOffsets ?? [0.0, 0.0];
}
/** /**
* Gets the value of flipX from the character data. * Gets the value of flipX from the character data.
* `!getFlipX()` is the direction Boyfriend should face. * `!getFlipX()` is the direction Boyfriend should face.

View file

@ -19,8 +19,10 @@ class CharacterDataParser
* The current version string for the stage data format. * The current version string for the stage data format.
* Handle breaking changes by incrementing this value * Handle breaking changes by incrementing this value
* and adding migration to the `migrateStageData()` function. * and adding migration to the `migrateStageData()` function.
*
* - Version 1.0.1 adds `death.cameraOffsets`
*/ */
public static final CHARACTER_DATA_VERSION:String = '1.0.0'; public static final CHARACTER_DATA_VERSION:String = '1.0.1';
/** /**
* The current version rule check for the stage data format. * The current version rule check for the stage data format.
@ -603,6 +605,8 @@ typedef CharacterData =
*/ */
var healthIcon:Null<HealthIconData>; var healthIcon:Null<HealthIconData>;
var death:Null<DeathData>;
/** /**
* The global offset to the character's position, in pixels. * The global offset to the character's position, in pixels.
* @default [0, 0] * @default [0, 0]
@ -695,3 +699,13 @@ typedef HealthIconData =
*/ */
var offsets:Null<Array<Float>>; var offsets:Null<Array<Float>>;
} }
typedef DeathData =
{
/**
* The amount to offset the camera by while focusing on this character as they die.
* Default value focuses on the character's graphic midpoint.
* @default [0, 0]
*/
var ?cameraOffsets:Array<Float>;
}