How do I move and attack at the same time

Just started using Construct 2? Post your questions here

Post » Sun Sep 25, 2016 10:27 pm

Hi there,

Im new here and the problem is when i stand still and a press enter it attacks , but when i move (run) while press enter it wont do nothing, and with and extra sub event it disturb my running animations and idle animation.
(meaning now for the moment its oke , when i run its running animation , and when i stand still the idle animation works fine, and if i press enter its attacks and go back to idle so great so far ,but when i want to attack while running , i do new sub event ........ and its all mest up.

Please help out a new noob :-)
cheers from Belgium
i would post a print screen but i dont now how to put it here :-s somebody help please
B
5
Posts: 2
Reputation: 231

Post » Mon Sep 26, 2016 12:54 am

Hey :D

You could make another animation... a running/attacking animation...

Or you could make the arm a separate sprite. Then Pin it to the player, and have animations for it. (like running, or attacking)
In this method you could have the arm doing anything while the body is still running.
Eat ALL THE BACON!
B
45
S
17
G
3
Posts: 290
Reputation: 4,993

Post » Wed Sep 28, 2016 1:59 pm

Do you pin your animations to a controller sprite?

You can avoid many animation issues by using a controller sprite object. Simply make a sprite that has your "characters" collision bounds (ie scaled to character sprite size with appropriate collision bounds) and then set it to invisible. Give your character that is animating a pin behavior and simply pin it to the "controller" sprite when it's spawned. The controller spite would get all the stuff you would put on your player.. instance variables, movement behavior, physics.. etc. and the animations would just be pinned to its location and not actually interacting with anything.

In your example you could then pin other invisible sprites to the controller for sword collisions and such and match them to animations...
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 636
Reputation: 9,333

Post » Thu Sep 29, 2016 2:01 am

Make a separate attack animation and assign it to a different button. so if running is the right arrow down make the spacebar call your attack animation. Or if the running button and the spacebar are down at the same time attack. You could even do if the player is within a certain distance of the enemy you can call your attack animation.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
32
S
15
G
3
Posts: 356
Reputation: 5,269

Post » Sat Oct 01, 2016 1:37 pm

many thanks for the reply's
B
5
Posts: 2
Reputation: 231


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest