Range and cooldown bullet.. help [Solved]

Get help using Construct 2

Post » Tue Oct 28, 2014 6:35 am

here is my game file.
RunnerArduino.capx

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
You do not have the required permissions to view the files attached to this post.
Last edited by milktea93 on Tue Oct 28, 2014 8:11 am, edited 1 time in total.
B
5
Posts: 17
Reputation: 257

Post » Tue Oct 28, 2014 6:49 am

(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.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 636
Reputation: 9,333

Post » Tue Oct 28, 2014 6:54 am

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
B
245
S
39
G
15
Posts: 1,941
Reputation: 40,246

Post » Tue Oct 28, 2014 7:05 am

Lordshiva1948 wrote: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..
bullet_test.capx
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 17
Reputation: 257

Post » Tue Oct 28, 2014 7:06 am

chrisinfinger wrote:(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
B
5
Posts: 17
Reputation: 257

Post » Tue Oct 28, 2014 7:48 am

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.
Last edited by GenkiGenga on Tue Oct 28, 2014 8:14 am, edited 1 time in total.
ImageImage
B
112
S
23
G
7
Posts: 1,064
Reputation: 12,787

Post » Tue Oct 28, 2014 7:55 am

GenkiGenga wrote: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
B
5
Posts: 17
Reputation: 257

Post » Tue Oct 28, 2014 7:56 am

GenkiGenga wrote: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
B
5
Posts: 17
Reputation: 257

Post » Tue Oct 28, 2014 7:56 am

haha no problem, i hate when that happens :)
ImageImage
B
112
S
23
G
7
Posts: 1,064
Reputation: 12,787

Post » Tue Oct 28, 2014 8:06 am

GenkiGenga wrote:haha no problem, i hate when that happens :)


Thank You! It work perfectly!!
B
5
Posts: 17
Reputation: 257


Return to How do I....?

Who is online

Users browsing this forum: jkmalau and 17 guests