How can I make shooting animations as well as running and shooting animations?

Rperlish

  • Posts: 6
I need to know how to make my character make a shooting animation in a 2D platformer. I also need to know how to make my character do a running while shooting animation. For answers, I would like for an image of the events I need to do (though not required). I need them to have events that allows me to have double-sided animations. I would appreciate an answer.

« Last Edit: March 31, 2015, 09:44:45 am by Rperlish »

robrob

  • Posts: 42
I would imagine you'd need something like

If RIGHT is pressed, play Right Run animation
Else If RIGHT and SHOOT is pressed, play Right Run and shoot animation
Else If LEFT is pressed, play Left Run animation
Else If LEFT and SHOOT is pressed, play Left Run and Shoot animation

There may be more bits and bobs but that's the basic idea.

robrob

  • Posts: 42
Also, this thread isn't complete / solved as yet, but you may find it interesting:

http://community.stencyl.com/index.php/topic,39907.0.html

MadManAdam

  • Posts: 371
You basically need two animations, one for static shooting (no running) and one for shooting while running.  Left or right it doesn't matter, you can then flip the animation to use for both left and right, unless you want them to be different then you would need four different animations to cover everything.  Hope that helps.  Also robrob has the right idea as for how the code would look.

Bhoopalan

  • Posts: 1018
I would imagine you'd need something like

If RIGHT is pressed, play Right Run animation
Else If RIGHT and SHOOT is pressed, play Right Run and shoot animation
Else If LEFT is pressed, play Left Run animation
Else If LEFT and SHOOT is pressed, play Left Run and Shoot animation

There may be more bits and bobs but that's the basic idea.

That seems correct. However, I assume if the player is running right and also shooting, "If RIGHT is pressed, play Right Run animation" will be triggered (as right is pressed) and the "Else If RIGHT and SHOOT is pressed, play Right Run and shoot animation" would be ignored.

Instead, something like this might work:

If RIGHT is pressed,
    If SHOOT is pressed
        play Right Run and shoot animation
    otherwise
        play Right Run animation
 
But this all in theory from the looks of the codes. I haven't tested anything.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

Rperlish

  • Posts: 6
@robrob @Bhoopalan sorry for the late reply. I tried both of your ways no both of them didn't work. Could you guys maybe test it out before telling me, then if it works, post an image of the events? I would also appreciate someone telling me what events I need to use for an idle shoot animation, with an image of the tested events. Sorry if I sound a bit demanding, it's just that I kinda need a firm answer that's not only a theory, but a tested theory. I would appreciate the help.

Bhoopalan

  • Posts: 1018
Share your code snippet and we might see what goes wrong.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

rambunctious10

  • Posts: 58
I think what I would do is this:

       
I ♥ coding.

rambunctious10

  • Posts: 58
Then you would need to add the left and shooting animations also. You would add the running and shooting animation in the right and left animation change blocks.
I ♥ coding.

Rperlish

  • Posts: 6
@rambunctious10             I tried doing that for the shooting while walking animation events, but it didn't work. Here's a screenshot of it so you can correct me




(P.S. I don't need a walking animation because I already have it)