Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxTrail code style and organization #447

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

Geokureli
Copy link
Member

Allows more customization of FlxTrail by separating behavior into separate methods, for instance to accomplish #443
is as simple as:

class OffsetTrail extends FlxTrail
{
	/**
	 * An offset applied to the target position whenever a new frame is saved.
	 */
	public final frameOffset = FlxPoint.get();
	
	override function addTrailFrame()
	{
		super.addTrailFrame();
		
		_recentPositions[0].addPoint(frameOffset);
	}
	
	override function destroy()
	{
		super.destroy();
		
		frameOffset.put();
	}
}

@Geokureli Geokureli added this to the 3.3.0 milestone Oct 2, 2024
@Geokureli Geokureli merged commit 07c3f07 into HaxeFlixel:dev Oct 2, 2024
10 checks passed
@Geokureli Geokureli deleted the trail-redux branch December 10, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant