[Resolved] Stopping input during an attack

Get help using Construct 2

Post » Wed Feb 13, 2013 9:03 am

Currently working on a game where when on the ground the player stops moving and does the attack animation, then can either attack again or move afterwards.

DELETED

Currently while moving, it breaks the animation loop for attacking and thus prevents it from going through as I have it triggered on animation statuses.

Idealy there would be a fraction of a second time between when the player gets control to attack VS the player gets control to move, however I'd probably go for a simpler solution if that is complicated.Thndr2013-02-13 20:29:16
B
15
S
4
G
4
Posts: 294
Reputation: 3,225

Post » Wed Feb 13, 2013 8:04 pm

I can't look at the capx right now, but the basic premis is to simply do this.

Add a variable that becomes active every time the player presses the attack button

on keyboard pressed "A"
->set "attacking" to 1
->play animation "attack"

then in the section that has all of your movement stuff.
add a condition that only allows the player to move if "attacking" is set to 0

on keyboard pressed "right arrow"
AND
(system) attacking = 0
-> move player right.

this way it will only work while not attacking.

B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Wed Feb 13, 2013 8:28 pm

Thanks for the reply.

After looking into it, set it a number value and still didn't stop, but then I added a Wait 0.1 to the beginning of the attack function and it made it work properly.
B
15
S
4
G
4
Posts: 294
Reputation: 3,225


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Popcan151, Skebab, Yahoo [Bot] and 14 guests