How do I make my enemy shoot

Get help using Construct 2

Post » Tue Dec 02, 2014 11:07 pm

Hi all,

i want the enemy to shoot every X seconds (which is no problem) but starting already with the 0 second...and then every x second. Because when my character moves toward the enemy and timer starts, its already too near him when he begins to shoot. Any ideas?
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Wed Dec 03, 2014 8:56 am

You could use a boolean like structure.
you create a boolean variable set to false (or use 0 for false and 1 for true)
When the enemy sees the player and the boolean is false, shoot and set the boolean to true.
Then every x seconds, if the boolean is true shoot again.
if the enemy can't see the player anymore, set the boolean to false again.
B
18
S
5
G
3
Posts: 30
Reputation: 4,138

Post » Wed Dec 03, 2014 11:38 am

Download this capx and see you will have clue.

http://gamedevelopment.tutsplus.com/tut ... edev-13815
Image
B
50
S
12
G
1
Posts: 254
Reputation: 4,456

Post » Fri Dec 05, 2014 10:26 pm

Thanks got it :)
B
8
S
4
G
1
Posts: 191
Reputation: 1,873


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 68 guests