Skip to content

A simple Tailed Sprite class for rendering sustain notes

License

Notifications You must be signed in to change notification settings

picnicpip/FlxTailedSprite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FlxTailedSprite

A specialized class for the HaxeFlixel game engine, designed specifically for rendering sustain notes in rhythm games.

This class extends FlxSprite to provide tiling capabilities, making it easy to create dynamically-sized sustain notes. This class also supports animated sprites, flipping and rotation.

The frame gap fix was made by RapperGF

Usage

Here is a basic example of how to use FlxTailedSprite in your project:

var sustain:FlxTailedSprite = new FlxTailedSprite(100, 100);
sustain.loadGraphic("assets/sustain.png", true, 50, 50);
sustain.animation.add("body", [0], 25);
sustain.animation.add("tail", [1], 25);
sustain.animation.play("body");

// Specify the animation to use for the tail
sustain.setTailAnim("tail");

add(sustain);

/* 
 * In your update loop, you can dynamically change the height
 * This is useful for when a player is holding a sustain note
 */
override public function update(elapsed:Float):Void
{
    super.update(elapsed);
    sustain.update(elapsed);
    sustain.height = ...; // Your height logic here
}

About

A simple Tailed Sprite class for rendering sustain notes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages