How can I disable an even for a short time in the game.

Get help using Construct 2

Post » Mon May 25, 2015 12:46 am

I want to make it so the player is unable to shoot while an animation is playing. So while the two second reload animation is playing I want to disable an event and allow it to resume after.
B
3
Posts: 4
Reputation: 183

Post » Mon May 25, 2015 4:38 am

Create a global variable or create an instance variable within the player and use to create a dual condition. Make it Boolean if it's an instance variable. Call it "Can_Shoot" and set it to true by default. When the two reload create an event to change the value to false, then change it back to true after they reload.

On Key Press> Player > Spawn Bullets
Player > Can_Shoot
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Mon May 25, 2015 12:24 pm

or
Make an instance variable (Can_shoot) for the player sprite (in the below example the player is Sprite)
(one instance variable (number))
and in this case the reload animation is named reload
and when the reload animation is finished then......
..
When you make the instance variable for the player sprite, the remember to set initial value of the Can_shoot instance variable to 1 when you make it.
Image
B
36
S
10
G
4
Posts: 250
Reputation: 7,963

Post » Mon May 25, 2015 4:45 pm

or to be even more simple, getting rid of the necessity for a variable at all:

Image
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Mon May 25, 2015 7:13 pm

Can some one tell me what's going wrong.
I've tried a few methods that all seem to fit the correct logic but none of them have actually worked.
Image
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: Armench, Blendi1223 and 16 guests