*EDITED* How do I Fire "X" Number Of Spears Then Wait

Get help using Construct 2

Post » Fri Dec 12, 2014 2:44 am

I figured out an earlier post but now I have a new dilemma.

I want to fire off 3 or 4 spears in 0.5 seconds then wait 1.5 secs to fire another group.

Can someone point me to a tutorial or explain how i can make this work?

I've tried using a LOOP, System Wait, and adding 3 separate actions but they don't work. It only fires off spears every 0.5 secs.

Thanks for any help.
Last edited by jeffige on Fri Dec 12, 2014 6:04 pm, edited 1 time in total.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Fri Dec 12, 2014 3:00 am

here ya go, hope this helps

Image
B
8
S
1
Posts: 74
Reputation: 725

Post » Fri Dec 12, 2014 11:34 am

you provided too little info.

do you need that to be fired off constantly in that fashion? 3-4 spears each with 0.5 sec diff, then 1.5 sec pause and repeat forever?
or do you need that to happen once? (6-8 spears all together)?

also mordiaky gave you a nice solution to throw5 infinitely. if you want to cancel it, add another variable name it "number of throws", set to 0, and increase every time throw5=4. also add subevent that will fire off and cancel further firing. you should put that in a group and disable it.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
42
S
14
G
12
Posts: 624
Reputation: 9,421

Post » Fri Dec 12, 2014 5:30 pm

Hey thanks for the replies.

I guess i did provide too little information, usually i'm too in-depth.

The game is set in dungeons. The player must traverse deadly traps to get out. One of the traps are spears that fire off from "TUBES" if/when the player is within a set distance away of each separate tube. The spears WILL CONTINUE to fire if the player is within the LOS and stop if he isn't.

My problem is that there will be several of these traps scattered around the layout(s). I'd like to get them to each fire at different intervals.

One location may Fire 3 spears at 0.5 intervals.
Another location Fires 1 spear every 0.7 secs.
And yet another Fires 5 spears at 1.2 sec intervals.

Using mordiaky's example, wouldn't the "spear traps" all fire at the same rhythm throughout the layout(s)?

*EDIT*
I tried adding "turret behavior to "Tube1" which will actually spawn the spears and changing the rate of fire, but I'd have to add separate EVENTS for each of the tubes. And RANDOM wouldn't work because then each TUBE would choose RANDOM fire rates.

https://www.dropbox.com/s/k5l89c3ulmnhbcy/MyGame_2.capx?dl=0

Again, thank you for the replies.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, Shenkai the ssj and 23 guests