Bug? Reload time system

0 favourites
  • 4 posts
From the Asset Store
A sound pack containing 132 laser gun sound effects, including mono and stereo versions of audio files.
  • Hey all, again!

    I'm starting to develope a 2d shooter sidescroller with construct2 and of course for that I need a "reload time" for the ranged weapons.

    I've created it but I have a problem, all goes fine before the reload time, when the reload time is active (2 sec, a pistol test) it goes well and the ammo is set to 9 again. I've set that when you shoot, the ammo substract 1 when is shooted to the ammo, BUT after the reload time (2sec) it waits another aditional 4 seconds by the face to allow the bullets to substract again.

    So after the reload time (2 seconds) the ammo indicator goes 9 AGAIN BUT if I shoot the 9 ammo doesn't go low after 4 seconds by the face.

    I don't know if I mean it correct.. so I've uploaded the capx. Test it and see what happens and after that, please. Answer me!

    http://devmidgard.com/games/unsurvive/source/source.zip

  • Put in a 'System: Trigger Once' into event 4 so it only happens one time when ammo = 0. And then you can have 'System: Set testgunammo to 5' right after the 'wait 2 seconds'. And get rid of the testgunammomoreloadtime stuff.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/reload.png" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ramones Thanks! Working fine now :D

    But can yo explain me how it works?

  • It's fairly self explanatory I think. Event 3: when the ammo reaches 0, wait 2 seconds and then set it back to 5. The 'trigger once' ensures the event doesn't fire repeatedly when the ammo is 0.

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