How do I make enemies shoot whenever they want?

Get help using Construct 2

Post » Thu Jul 28, 2016 10:13 am

Message: APalFromHawaii can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
http://imgur.com/a/GgWrp
Here i have three enemies.
I want them to shoot whenever they want aka randomly.. but how?
In my previous games i used 'Every X milliseconds -> trigger once -> sprite spawn object'
But that way they all will shoot at the same time. I don't need that.
Please help!
B
3
Posts: 4
Reputation: 183

Post » Thu Jul 28, 2016 10:39 am

you can use

for each enemy
every random(5,10) seconds = random between 5 to 10 seconds.

just set how often and it will pick a random number between those?

i think that could work.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 987
Reputation: 12,646

Post » Thu Jul 28, 2016 10:46 am

tunepunk wrote:you can use

for each enemy
every random(5,10) seconds = random between 5 to 10 seconds.

just set how often and it will pick a random number between those?

i think that could work.

can i do this in construct classic?
B
3
Posts: 4
Reputation: 183

Post » Thu Jul 28, 2016 12:23 pm

I have no idea, I never used construct classic.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 987
Reputation: 12,646

Post » Thu Jul 28, 2016 1:30 pm

I would suggest to avoid loops whenever it is possible. Instead you can use Timer behaviour + random function as @tunepunk suggested.
ImageImageImage
B
27
S
16
G
80
Posts: 1,014
Reputation: 44,747


Return to How do I....?

Who is online

Users browsing this forum: ditocruz and 21 guests

cron