It is my first time posting here. I'm loving C2.
I have a simple question... I think. But I don't know how to go about and do it.
In bomb jack, the player has to collect the bombs to score.
However there is always one bomb that is lit. If you pick up that bomb you get a bonus and a new bomb turns on.
<img src="http://retroflash.net/wp-content/uploads/2012/11/bomb_jack.jpg" border="0" />
the bomb on the top left is lit.
How do I go about doing that? It can't be scripted I think because you have to take in consideration that some bombs might not exist already because the player collected them.
Thanks a lot.
Boolean instance variable
.special = True or False
If Bomb.Special then
do special bomb stuff
do Regular bomb stuff
I didn't explain myself well because I didn't want the post to be too long.
My doubt is more about how to attribute the "special" to a Bomb instance variable in a specific order, taking into consideration the bombs that might have been picked up already.
You could always pick a random bomb to have the special "lit" designation.
Use the picking functions. Under system menu you'll find 'pick random instance' which would pick a single, random bomb. Or you could do it in more ordered fashion by using IID's and UID's.
Give your bombs two instance variables
Then assign a specific order for each of your bombs starting from 0
The event should look like that:
Global number currentBomb = 0
+ System: bomb.Count > 0
+ System: while
+ System: order != currentBomb
-> add 1 to currentBomb
+ bomb: order = currentBomb
+ bomb: [invert] is activated
-> bomb: set activated to true
+ bomb: is activated
-> do things
!= means different
And be carefull this condition should really be a system event, not an object event (not object: order != currentBomb)
Develop games in your browser. Powerful, performant & highly capable.
I will try Yann's method as I want to control the order of the bombs being lit.