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

0 favourites
  • 4 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • 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.

  • here ya go, hope this helps

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)