buttons help please?
linemaniac231
Member Posts: 7
In a game I am making, you destroy all the enemies in each level to move on. Does anyone know a way to make a button pop up ONLY after you have destroyed each enemy?
Comments
where x is your game attribute selected through the expression editor and attribute browser.
In you game attributes you want to make a new one call it, for intents and purposes, call it "Enemy count".
Make that equal to the number of enemies you want the player to kill.
Next, go back to the "Actors" panel and open up the actor that's your enemy.
Inside of his behaviors, hopefully you have some condition for when the enemy is destroyed. (i.e. collides with bullet or whatever) Inside of that Rule block, place a "Change Attribute" behavior before the "Destroy" behavior.
On the Change Attribute box you added, click on the "..." next to it. In the first panel of that window that pops up, click on "Game", the double click "Enemy Count".
In the next box, click the e (which is called the "Expression Editor"). In the window that pops up, click the blue arrow next to he check mark. Click on "Game" then "Enemy Count". Now click by the blue oval saying "game.Enemy Count". Type "-1". Click the green check mark.
Now inside of another actor, create a rule that states "An attribute changes game.Enemy Count is equal to 0". Inside of that put a "Spawn Actor" behavior. Make it spawn the button at 240, 180 relative to scene (that way it's in the middle of the screen).
Hope that helps.