Destroying dots on miniMap...?
allc1865
Member, PRO Posts: 777
Hey guys. On my miniMap I have dots the represent the enemies in my game. After I kill all the enemies, there's always one enemy dot left on my map that's not an enemy. How would I destroy the dot after all enemies are killed?
Thanks
Thanks
Best Answer
-
Braydon_SFX Posts: 9,273That dot is an actor, so you could arrange something like this:
Create an Integer game Attribute called "HowMany." Leave the value at 0 for now.
In your enemy actor, add a Change Attribute:
Change Attribute: game.HowMany to game.HowMany+1
Make sure that the Change Attribute behavior is at the top of your logic stack.
Next, when you destroy an enemy, add a Change Attribute:
Change Attribute: game.HowMany to game.HowMany-1
Then create a rule in your dot actor:
When attribute: game.HowMany = 0
Destroy
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Answers
Thanks!
When attribute: game.HowMany = 0
Destroy
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Hope that helps! Thanks!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
This method assigns a unique ID to each main coin, and mini map coin.
When I touch a main coin, I change a game attribute to the ID number of that main coin, for example, 2.
Then in the mini map coin, I say when that game attribute = the unique ID for the mini coin, for example 2, then destroy.
A mouthful, but you'll see what I'm talking about when you open the project.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Here's my template if you want to look at it.
Thanks...
https://www.dropbox.com/s/44r3p3rgtum67m3/MiniMap Game.zip
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx