Andythehedgehog Posted February 21, 2007 Report Share Posted February 21, 2007 I'm going to put these in my fan game but I don't know how to program them. Can somebody help me? Thanks. Link to comment Share on other sites More sharing options...
DimensionWarped Posted February 21, 2007 Report Share Posted February 21, 2007 Guaaaah! Gross. Sonic Advance 2 repeat gimmicks. Well, you'd first want to disable the x and y movement of the character. I'm assuming you are using 360... so you'll have to come up with a decent way to do this (In the gimmick pack I'm working on, I added movement lock features to the basic variables. You'll want to assign an action of swinging, and while swinging, you'll want Sonic to use the swinging animation... which should auto force your position to be where the swing is and to have Sonic locked in the direction of the swinging thing and have the hotspot for all directions of the animation be at his hands or at the point where the item's center would be. With Sonic's position locked there and the animation playing, you need to make it to where he can launch when jumping. For that, you'd first disble your swinging action then enable your jumping action. For determining the gravity and actual speed when launching, just use some basic trig. Actual speed = Base Force * sin of direction Gravity = Base Force * cos of direction. To all you trig heads, this might seem the opposite of what it should be... but presumably, you are facing right when Sonic is to the right of the device, so the tangential vector would have a direction of up. Thats pretty much all there is too it. Link to comment Share on other sites More sharing options...
Felik Posted February 22, 2007 Report Share Posted February 22, 2007 Despite using this: Actual speed = Base Force * sin of direction Gravity = Base Force * cos of direction. You can do it in a VERY easy way. You can just program special values for each animation frame. Just like this: If pressed A or B (or whatever you want) and if animation frame is "for example 1" then set speed to "for example dir*3" and set gravity to 4" If pressed A or B (or whatever you want) and if animation frame is "2" then set speed to "dir*4" and set gravity to 5" If pressed A or B (or whatever you want) and if animation frame is "3" then set speed to "dir*6" and set gravity to 3" and etc for each animation frame. This method is easier and you don't have to change direction of sonic object. If you need I can make a tutor for you. (I'm using MMF2) Link to comment Share on other sites More sharing options...
Blue Frenzy Posted February 22, 2007 Report Share Posted February 22, 2007 Blah blah blah, and then you will make something unstable and the character won rotate well. I will just make an animation that has the hotspot on the center of the object and then rotate the animation. change the direction depending of speed and after button is pressed, use sin and cos to add speed to sonic. This method will make the character to stay in the center of the object instead positioning it each frame making you to calculate each direction hotspot to make it fit on center of the object. Just +if sonic collides object +flag 1 (object) is off sonic-> look at object (0,0) object-> set flag 0 on object->set valueA to sqr(sonic(speed)*sonic(speed)+sonic(gravity)*sonic(gravity)) +flag 0 (object) is on sonic(x)=object.x sonic(Y)= object.y sonic(Angle)=0 sonic-> direction= sonic(direction)+object(valueA)/10 Link to comment Share on other sites More sharing options...
Felik Posted February 23, 2007 Report Share Posted February 23, 2007 And why the character has to rotate? It will just animate and that's all. Hotspot will be in the center of his hands. Link to comment Share on other sites More sharing options...
Recommended Posts