Range and cooldown bullet.. help [Solved]

  • here is my game file.

    [attachment=0:3kp78hgj][/attachment:3kp78hgj]

    I need to set the range of bullet , after the range of bullet shooted , it will destroy..

    second , I need to do the cooldown 1sec for the bullet to reload

  • (bullet) On Created: wait (time in seconds that matches distance you like based on your bullet speed setting)

    then destroy self.

    Add an instance variable to your player called reloading=0 (or whatever name you want) and then In your fire conditions have reloading=0 and in its actions have: reloading=1, wait 1 second, reloading=0.

  • Bullet distance travel > say 400 then bullet destroy

    Instance var reload=0

    reload=1

    system wait 1 sec or whatever you wish

    set reload to 0 again

  • Bullet distance travel > say 400 then bullet destroy

    Instance var reload=0

    reload=1

    system wait 1 sec or whatever you wish

    set reload to 0 again

    I had tried your method..

    after greater or equal than 50 , the bullet just destroy forever.. cannot shoot agian...

    my file.. [attachment=0:id727vl0][/attachment:id727vl0]

  • (bullet) On Created: wait (time in seconds that matches distance you like based on your bullet speed setting)

    then destroy self.

    Add an instance variable to your player called reloading=0 (or whatever name you want) and then In your fire conditions have reloading=0 and in its actions have: reloading=1, wait 1 second, reloading=0.

    any example? I just find the charge bullet tutorial only... but no have cooldown method in the tutorial section

  • Try this : https://db.tt/8W9XTS7N

    I just changed a couple of things, now when you fire it will set the initial X value of the bullet to the bullet itself. When the bullet travels a predetermined amount (100 pixels in this case) it will destroy. Also uses a variable to make sure we cant fire more than 1 bullet per second.

  • Try this : https://db.tt/8W9XTS7N

    I just changed a couple of things, now when you fire it will set the initial X value of the bullet to the bullet itself. When the bullet travels a predermined amount (100 pixels in this case) it will destroy. Also uses a variable to make sure we cant fire more than 1 bullet per second.

    Thank ! but seem like this file created by R185 version.. I need to download the lastest version of contruct 2.. will tell you the result

  • Try this : https://db.tt/8W9XTS7N

    I just changed a couple of things, now when you fire it will set the initial X value of the bullet to the bullet itself. When the bullet travels a predermined amount (100 pixels in this case) it will destroy. Also uses a variable to make sure we cant fire more than 1 bullet per second.

    Thank ! but seem like this file created by R185 version.. I need to download the lastest version of contruct 2.. will tell you the result later

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • haha no problem, i hate when that happens

  • haha no problem, i hate when that happens

    Thank You! It work perfectly!!

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