jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.48k stars 739 forks source link

Pointing while left-right is turned on and rotation center is off causes weird behavior... #1454

Open Toddap opened 7 years ago

Toddap commented 7 years ago

Repro bug: http://snap.berkeley.edu/snapsource/snap.html#present:Username=juanitaintro&ProjectName=Mario%20-%20Bug

Just view the code and click on the two "point in direction" blocks.... The Mario sprite jumps up and down on the y axis even though the y position (and costume) don't change.

This happens (apparently) b/c the rotation center is at the bottom of the sprite and snap apparently is doing something odd/wrong when it does the flip from left to right action. BYOB does not have this behavior FWIW.

jmoenig commented 7 years ago

Yes, that's because the rotation center is at the bottom of the costumes in your project, and that's a feature. When you import the costumes the rotation center is automatically placed in the middle of a costume, that should work fine for your project.

You can also reset the rotation center's y-coordinate programmatically:

reset_rotation_y