The Daily Click ::. Forums ::. Klik Coding Help ::. Megaman-style shooting
 

Post Reply  Post Oekaki 
 

Posted By Message

Giga-Guy



Registered
  11/12/2004
Points
  33
25th April, 2005 at 21:29:16 -

Im working on a game that runs like MegaMan, (run, jump, shoot) an Ive done all the basic stuff (the movement engine, enemies, etc), but I just need a megaman-style shooting engine, that lets you shoot while running,jumping etc.
I cant really explain what I need, but I need to copy the shooting engine that the megaman games use, where, for example, when Megaman is walking, and the player pushes 'shoot', Megaman sticks his arm out and shoots, but his walking animation doesnt appear to change or get interrupted at all. His legs and left arm are still moving in time.
The only thing that changes is his right arm, which is held out while shooting, and when thats over, Megaman resumes his walking animation. Same goes for jumping, falling, standing, etc.

I once had a Megaman X style tutorial for TGF that worked like that, but that was ages ago, on my old computer. Now, the file is gone from the site, and thats not much use.
Ive tried to copy it, but I cant remember how they did it. So I tried my own techniques. One of them was having the right arm as a SEPERATE object, but that doesnt work, because it doesnt seem to 'stay in place' when the character is moving. And it cant stay in sync with the characters animations either.
I had another technique, but I cant remember it. I just remember it not working.


So... can anyone help me with that?

(I have a feeling that no-one gets exactly what I mean)

 
-coming soon-

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
25th April, 2005 at 21:34:47 -

I know what you mean.

The best way to to do this is with a separate object for the arm, and I guarantee you that's how you saw it done. Yes, it will lag behind if you're just using:
Always
-Arm: set position to (0,0) from Character

So don't do that. Instead, have a custom movement engine (which you'll need for megaman to move properly anyway) and just move the arm object whenever you move the character object.

 
n/a

Giga-Guy



Registered
  11/12/2004
Points
  33
25th April, 2005 at 22:36:13 -

Yeah, Im using a custom engine anyway. But Ive tried that technique, and even If i can keep the arm 'attached' the arm's animation wont stay in 'sync' with the body. But thanks. It never really occurred to me to use a custom engine for the arm aswell.
And the Megaman X engine I once had used another technique. It had the different shooting animations in different directions or something.

 
-coming soon-

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
25th April, 2005 at 23:10:39 -

I can't imagine why the animations wouldn't remain synchronised. Apart from after a shooting animation when it returns to the striding animation, I guess. In that case try this:
(assuming the gun is currently in its 'shooting' anim and you want to return to 'running,' the legs are in their 'running' animation)
Current frame of Legs = 0
--Gun: change animation sequence to running


That way the arm will stay out until the legs are back to their first frame before going back into the running animation, so they should both start on frame 0 of the animation at almost exactly the same time.

 
n/a

jast



Registered
  03/01/2014 01:12:19
Points
  186
30th April, 2005 at 19:00:07 -

If the arm lags behind the body, your event order is somehow messed up. Try to get both, your events and your events' actions in order. Etc.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
30th April, 2005 at 20:04:03 -

I think the animtions are even trickier to keep synced than keeping things movings synced. The problem is apparent if you think like this:

say there is 3 frames for the legs moving and 3 for the arms, they will match fine normally, but then when the arm changes to 'shooting' it will not affect the legs at all. Then when not shooting the arm will start 'walking' again but the legs may be at animtion frame 1 2 or 3. Its a one in 3 chance they will match.

 
.

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
30th April, 2005 at 21:24:08 -

Or do as I suggest, and allow the gun to stay out for a fraction of a second longer and only drop back to the running animation when it would be in synch.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
1st May, 2005 at 08:01:59 -

With your custom movement in use, you could have your standard animations mixed with directions. In other words, use left and right for the animation in standard mode ; while using diagonal directions for the shooting animations.

Here is how :

repeat while moved left
& flag 1 is off -set direction left (standard animation)

repeat while moved right
& flag 1 is off -vise versa (running for example)

When press fire 1 - set flag 1 on, and shoot

Flag 1 is on - add 1 to value A

Flag 1 is on & direction is (right) - set direction to up/right. e.g. running while shooting

Flag 1 is on & direction is (left) - set direction to up/left.

Value A is > 30 - set flag 1 off, set value A to zero.


It will work because the animation number is only reset when you change animation sequences - not direction.

(Html fixes things)

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click