Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF2] Rotation


Kessler12

Recommended Posts

I'm updating a character menu for SLWC, how can I make the character sprites rotate like in sonic 3's competition mode. Is there another way I can do it instead of the one on the main site?

Umm... Okay it's almost midnight here, so can I get back to you sometime? I'll try to work something out tomorrow.

Best thing I can think of at the moment is to tell it what angle it's supposed to be at and then create a method that rotates it to it's desired position, based on where you told it it needs to be... I'm probably not making much sense, I know...

So the selected character should be at 180 degrees, while the left and right should be at... Oh boy... 60 and 300 respectively. The hardest part about this would be flattening the circle into an oblong ellipse... Again, I'll get back to you on that.

Link to comment
Share on other sites

Ugh. Seriously? Animating this shit by hand? Learn a little trigonometry, it'll take you far.

You need two frames per character. One illuminated and one dark. Technically you could do this with palette tricks if you had shaders or something, but whatever. The default active character should have a value (angle) set to 0 while the other two are set to 120 and 240 respectively (each a third of the way to 360 degrees which is the full circle). As you change the active character, you'll want to first darken your active character sprite, then you start a mode where you gradually increase each character's angle by some amount per frame until you have increased everyone's angle value by 120, and then the one that reaches 360 should be dropped back to 0 and made the active character (alternatively if the player presses the other direction, decrease everyone by a total of 120 and increase whoever gets below 0 by 360) Illuminate the new active character once all movement is finished. You might also need to offset the angles a bit so that 0 is actually pointing to 270 so that zero is in front of the circle. No big deal.

Here's the fun part. Every frame that a sprite's angle value changes, set the x position to X_SHIFT * cos of that sprite's angle, set y psoition to Y_SHIFT * sin of that sprite's angle. You'll want Y_SHIFT to be slightly less than X_SHIFT if you are looking to emulate the style in Sonic 3's character select for competition mode.

Oh, one more thing. Whenever a sprite that is inactive moves to another position of inactivity (IE 120 moves to 240 or vice versa) move its drawing order to the back. That way you won't have a character being drawn in front of the active character.

For more fancy orbiting effects like this, feel free to take a look at the boss I made for Madcap Grotto a couple years ago.

Link to comment
Share on other sites

Ugh. Seriously? Animating this shit by hand? Learn a little trigonometry, it'll take you far.

You need two frames per character. One illuminated and one dark. Technically you could do this with palette tricks if you had shaders or something, but whatever. The default active character should have a value (angle) set to 0 while the other two are set to 120 and 240 respectively (each a third of the way to 360 degrees which is the full circle). As you change the active character, you'll want to first darken your active character sprite, then you start a mode where you gradually increase each character's angle by some amount per frame until you have increased everyone's angle value by 120, and then the one that reaches 360 should be dropped back to 0 and made the active character (alternatively if the player presses the other direction, decrease everyone by a total of 120 and increase whoever gets below 0 by 360) Illuminate the new active character once all movement is finished. You might also need to offset the angles a bit so that 0 is actually pointing to 270 so that zero is in front of the circle. No big deal.

Here's the fun part. Every frame that a sprite's angle value changes, set the x position to X_SHIFT * cos of that sprite's angle, set y psoition to Y_SHIFT * sin of that sprite's angle. You'll want Y_SHIFT to be slightly less than X_SHIFT if you are looking to emulate the style in Sonic 3's character select for competition mode.

Oh, one more thing. Whenever a sprite that is inactive moves to another position of inactivity (IE 120 moves to 240 or vice versa) move its drawing order to the back. That way you won't have a character being drawn in front of the active character.

Thaaaanks. I knew it involved sin/cos and two shift values, but I forgot that setting Y-shift lower would actually solve the problem. I was about to go and apply an after-the-fact fix to it that would force them to the proper positions.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...