|
Megaman - Cutman Weapon |
killocan
Member #1,556
October 2001
|
Hey! So, i'm creating a megaman clone, and now it's time to create the weapon from cutman, supper cutter. For reference, here a example of it being used in several cases: It's worth to notice that in the "going" path it is a very simple and always equal parabolic path, the thing is while it is returning. If megaman run towards or away from it or if megaman change its Y position, the weapon follows, but without affecting the weapon X velocity much or creating strange movements. I've tried using polar coordinates to simulate an ellipse but the result is not that close, i also tried to "seek" megaman while the weapon is returning using something close to Amarillion's tutorial: <a href="http://www.helixsoft.nl/articles/circle/sincos.htm" SINCOS </a> But it's not the same either. The closest i got was using splines and some cosine interpolation all together, but that's overkill, i guess. So how would you implement this weapon behavior? Thanks! |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Is the cutter's position relative to megaman? Then an ellipse would work for sure. f(x,y) = megamanpos() + ellipse(t);. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Audric
Member #907
January 2001
|
For the first half or 3/4 of animation, I would use a pre-set trajectory that completely ignores the players' original velocity and current position. No matter how fast the player is moving in any direction, the last frame will be exactly on him. edit: fixed formula, hopefully. |
Mark Oates
Member #1,146
March 2001
|
What happens if he dies in the middle of the arc? -- |
killocan
Member #1,556
October 2001
|
Edgar Reynaldo said: Is the cutter's position relative to megaman? Yes, it is. But a 'regular' ellipse do not behave like the cutter, as mentioned for the first half and so of the trajectory it ignores megaman current position, after that, it tracks him down, without losing all of its original trajectory, i.e, if you just fire and stay still the cutter do a full ellipse, otherwise it follows megaman. Mark Oates said: What happens if he dies in the middle of the arc? I tested it, the cutter "let it go" of following its original path and just fly "right" in an straight "line". Audric said:
For the first half or 3/4 of animation, I would use a pre-set trajectory that completely ignores the players' original velocity and current position. Interesting approach, as i said before, i used a mix of spline and interpolation to solve this, and i did notice that for 3/4 of the animation, the cutter dont bother about megaman pos, so i fixed the path using a spline, after that i update using a interpolation between its current position and megaman's. But the result although very close is not "a match", will try yours, seems legit, thanks for the clue. One (two?) question: 1- edited: i get it hehehe \o |
Audric
Member #907
January 2001
|
I didn't think so precisely at the time, but yes. You probably want the projectile to come back to center of body, so that the player turning left and right doesn't change the "target x". Kneeling/standing should affect the target y though (base y + character height/2) |
killocan
Member #1,556
October 2001
|
Well, i tried hauwhwauahw needs lots and lots of little tweaks to be equal, but it's a start. Also i need to draw the animation for megaman firing this weapon, it's different from the usual gun shooting animation. Thanks all! EDIT: Video showing the thing on game attached. Having problems with my YT account. |
|