Is there a better way to do this?

Get help using Construct 2

Post » Mon Mar 04, 2013 2:37 am



When user presses the space bar a rocket is spawned and fired towards the right.

If however, the player has bonus BulleyType type then two more rockets are spawned and fired at an angle.

My problem is that the user must have a rocket in their supply. As it stands the extra two rockets are not spawned if (section 35) they had only one rocket. The first bit of code (section 35) reduces rockets by one.

One way I can get around it is to set up another variable "just fired" which is set to true in the first section and tested in the second session instead of testing for rockets >= 1.

However, is there are more elegant way to do this? If so how?czar2013-03-04 02:43:30
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Mon Mar 04, 2013 3:07 am

Make a sub event under event 35:

System -> Compare Values BulletType >= 1
-- (Spawn your other two rockets)
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Mon Mar 04, 2013 3:42 am

Cheers. A new world has opened up for me :)
B
31
S
8
G
5
Posts: 436
Reputation: 5,836


Return to How do I....?

Who is online

Users browsing this forum: Colorfish, MarkThomas and 30 guests