If I have a game where an actor is moving around the screen collecting coins. How can I make it so once all the coins are collected the actor can move onto the next level?
Like, add rule, change attribute, cuz i dont get it.. it doesnt work, i made the invisible actor, did everything but doesnt work, do i have to add the actor in scene ? could you plz explain me ?
So I'm guessing you have some sort of player controlled actor that goes around collecting the coins?
This is what I would do:
1. Make an integer scene attribute called GameCoins and set it to however many coins will be on that scene
2. In each coin on the scene add these rules. If GameCoin - collides or overlaps - with actor of type - Player -Change Attribute - Scene.GameCoins to Scene.GameCoins - 1 -Destroy Actor
3. Inside the Player or some other actor add: If Scene.GameCoins = 0 -Go to Next Scene (or whatever scene you want to go to).
im stuck at step 2... 2. In each coin on the scene add these rules. If GameCoin - collides or overlaps - with actor of type - Player -Change Attribute - Scene.GameCoins to Scene.GameCoins - 1 -Destroy Actor
i cant get the scene.gamecoins option at -Change attribute - Scene.GameCoins to Scene.GameCoins -1 .... And yes I've made the scene attribute..
If you have clicked the (scene) button, and then the + button, and created a new attribute in scene, you should find the above to show up.
Click create rule, then in rule change attribute, then you'll find a drop down where you can select options, one will be scene, then under scene the attribute you created. Then in the next box, click the drop down again, and scene again, and theattribute you created, and then type in -1 at the end, then the green check.
good luck. If you're still stuck, screen shot, post.
Comments
and in wich actor do i have to add the rule with game.coins = 0 ?? in the actor self or background? or the coinds??
Doesn't matter really, but I would put it in the coin.
Ace
Also, make sure in the coin, if collision with (actor) game.coin = game.coin+1
then you need another actor, invisible, rule if game.coin = 10 (or whatever) next level
Like, add rule, change attribute, cuz i dont get it.. it doesnt work, i made the invisible actor, did everything but doesnt work, do i have to add the actor in scene ? could you plz explain me
This is what I would do:
1. Make an integer scene attribute called GameCoins and set it to however many coins will be on that scene
2. In each coin on the scene add these rules.
If GameCoin - collides or overlaps - with actor of type - Player
-Change Attribute - Scene.GameCoins to Scene.GameCoins - 1
-Destroy Actor
3. Inside the Player or some other actor add:
If Scene.GameCoins = 0
-Go to Next Scene (or whatever scene you want to go to).
2. In each coin on the scene add these rules.
If GameCoin - collides or overlaps - with actor of type - Player
-Change Attribute - Scene.GameCoins to Scene.GameCoins - 1
-Destroy Actor
i cant get the scene.gamecoins option at -Change attribute - Scene.GameCoins to Scene.GameCoins -1 ....
And yes I've made the scene attribute..
Damn.. hard
Click create rule, then in rule change attribute, then you'll find a drop down where you can select options, one will be scene, then under scene the attribute you created. Then in the next box, click the drop down again, and scene again, and theattribute you created, and then type in -1 at the end, then the green check.
good luck. If you're still stuck, screen shot, post.
http://ScrnSht.com/qtmfgq
and yes i have made the screen attribute