HaxeFlixel / HaxeFlixel/flixel-docs
Tutorial Pt. 4 contains sprite animation error
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 86
- Forks
- 132
- PR merge metrics
- No merged PRs in 30d
Description
Part 4 - "Sprites and Animation" contains a slight error in the code.
In step 3, the code is supposed to "end with the player in their 'neutral' pose (legs together), that way each time we animate the player, it will return to the correct frame as soon as they stop animating"
However, that doesn't seem to be working. After moving, the animation always stops on the last frame where one leg is out. Maybe the player sprite got updated after the tutorial and the frames changed?
Either way, the solution is simply to move the first frame numbers in each array to the very end of the array, like this:
animation.add("lr", [4, 3, 5, 3], 6, false);
animation.add("u", [7, 6, 8, 6], 6, false);
animation.add("d", [1, 0, 2, 0], 6, false);
That way the animation sequence will end with the neutral pose.
Another solution I found online was to add the code below after if(up || down || left || right){:
else if(animation.curAnim!=null)
{
animation.curAnim.curFrame = 0;
animation.curAnim.pause();
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the Part 4 “Sprites and Animation” tutorial and inspect step 3, especially the three animation arrays. Update the documented sequences so each ends with the neutral pose, then verify the example matches the behavior described when movement stops.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation, game-dev
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100