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.x = boyfriend.getGraphicMidpoint().x;
cameraFollowPoint.y = boyfriend.getGraphicMidpoint().y;
var offsets:Array<Float> = boyfriend.getDeathCameraOffsets();
cameraFollowPoint.x += offsets[0];
cameraFollowPoint.y += offsets[1];
add(cameraFollowPoint);
FlxG.camera.target = null;

View File

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

View File

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

View File

@ -19,8 +19,10 @@ class CharacterDataParser
* The current version string for the stage data format.
* Handle breaking changes by incrementing this value
* 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.
@ -603,6 +605,8 @@ typedef CharacterData =
*/
var healthIcon:Null<HealthIconData>;
var death:Null<DeathData>;
/**
* The global offset to the character's position, in pixels.
* @default [0, 0]
@ -695,3 +699,13 @@ typedef HealthIconData =
*/
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>;
}