bullet

Get help using Construct 2

Post » Fri Jun 29, 2012 11:12 pm

i have this capx
https://dl.dropbox.com/u/67034121/scirra%20construct2/enemybullet.capx
in this capx there is 3 enemy should spawn bullet but i want to control these bullets and enemies what i want to do is :
1)variable timer use to know the time for each enemy to spawn the bullet so if i set 5 the enemy will spawn 1 bullet every 5seconds and enemy with 2 will spawn every 2 sec , i tried many ways but failed

2) variable on (boolean) i used for stop spawning more than one bullet each enemy .

3)variable destroy this used to set the time in second that the bullet will take to destroy , i also failed in this :(

so want to control how many second the enemy should take to spawn and the enemy keep spawning every that seconds, and i want to control the bullet time to destroy it ,
( of course there is no different that spawning count after bullet destroy or when bullet spawn)
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Fri Jun 29, 2012 11:30 pm

Do you mean something like this?

BulletSpawnTimer.capx (r97)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jun 29, 2012 11:39 pm

yes but can't i make the time with the enemy because i want each enemy has his own waiting bullet time before destroy . like 1 bullet destroy after 1 the other from 3 and so on ...
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Fri Jun 29, 2012 11:44 pm

Okay, just make a "maxDestroy" variable in the enemies, set that to whatever you want the destroy time to be. Then when the bullet is spawned, set the bullet's "destroy" to the enemy's "maxDestroy".
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Jun 30, 2012 5:20 am

@Nimtrix , i did this before in 2 different ways and both failed
1) spawn bullets and all destroy together
2) spawm many bullets and none of them get destroy

here capx :
https://dl.dropbox.com/u/67034121/scirra%20construct2/BulletSpawnTimer.capx
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sat Jun 30, 2012 11:59 am

Here's what I meant, hope it helps:

BulletSpawnTimer_Updated.capx (r97)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Jun 30, 2012 12:20 pm

@Nimtrix , thanks ^^
B
48
S
15
G
6
Posts: 795
Reputation: 12,035


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests