Kessler12 Posted September 10, 2013 Report Share Posted September 10, 2013 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? Link to comment Share on other sites More sharing options...
TailsSena Posted September 10, 2013 Report Share Posted September 10, 2013 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 More sharing options...
Mr. Potatobadger Posted September 10, 2013 Report Share Posted September 10, 2013 Personally, I cheat with this kind of thing. I usually make an animation. It may sound hard, but its pretty easy to do. I will get back to you later when i finish an example. oh, and do you mean the character select thing? I'm pretty sure you do. If you don't, i have no idea what you're taking about. Link to comment Share on other sites More sharing options...
DimensionWarped Posted September 10, 2013 Report Share Posted September 10, 2013 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 More sharing options...
Mr. Potatobadger Posted September 10, 2013 Report Share Posted September 10, 2013 Well shucks, I wasted about 3 minutes doing this example then. http://www.mediafire.com/?tsw9uc01u12bwlw Link to comment Share on other sites More sharing options...
TailsSena Posted September 10, 2013 Report Share Posted September 10, 2013 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 More sharing options...
Kessler12 Posted September 12, 2013 Author Report Share Posted September 12, 2013 I'm testing it out now, Thanks for the help guys! Link to comment Share on other sites More sharing options...
Recommended Posts