Skip to content

Commit

Permalink
flxtrail separate function for update
Browse files Browse the repository at this point in the history
revert additional function

spacing
  • Loading branch information
ninjamuffin99 committed Sep 22, 2024
1 parent 8649eb6 commit 007bd90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flixel/addons/effects/FlxTrail.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class FlxTrail extends #if (flixel < "5.7.0") FlxSpriteGroup #else FlxSpriteCont
*/
public var target(default, null):FlxSprite;

/**
* Useful if you need to have more granular control over per-sprite offsetting.
*/
public var effectOffset(default, null):FlxPoint = FlxPoint.get();

/**
* How often to update the trail.
*/
Expand Down Expand Up @@ -164,7 +169,7 @@ class FlxTrail extends #if (flixel < "5.7.0") FlxSpriteGroup #else FlxSpriteCont
spritePosition = FlxPoint.get();
}

spritePosition.set(target.x - target.offset.x, target.y - target.offset.y);
spritePosition.set(target.x - target.offset.x - effectOffset.x, target.y - target.offset.y - effectOffset.y);
_recentPositions.unshift(spritePosition);

// Also do the same thing for the Sprites angle if rotationsEnabled
Expand Down

0 comments on commit 007bd90

Please sign in to comment.