Skip to content

Conversation

@mikeharv
Copy link
Contributor

@mikeharv mikeharv commented Oct 28, 2025

Relates to:

This adds a way for generated dancer sprites to effectively mirror dance moves when needed. The GeneratedDancer layer will now manage a mirror property that gets updated during the sprite's updateSpriteFrame loop. When the animation has finished, we flip the mirror value. p5 handles the rest. This is only needed for dance moves that require mirroring.

With this change, generated dancers will be able to follow static sprite-sheet dancers across a sequence of any moves:

Before:

before.mp4

After:

2025-10-28.15-30-27.2025-10-28.15_31_02.mp4

@mikeharv mikeharv marked this pull request as ready for review October 28, 2025 20:06
@mikeharv mikeharv requested a review from a team October 28, 2025 20:07
Comment on lines 43 to 44
this.shouldMirror = 1;
this.mirror = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these be true instead of 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used -1 | 1 to align to p5.play: https://code-dot-org.github.io/p5.play/docs/files/lib_p5.play.js.html

.mirror needs to stay that way but .shouldMirror could change to a boolean easily enough.

Copy link
Member

@breville breville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mikeharv mikeharv merged commit 5464467 into main Oct 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants