How to destroy the top enemy of a pile by clicking on it?
carecuxo
Member Posts: 6
Hello guys, I am new to Gamesalad, and I am using this project to learn how to work with the program.
In this game, you must click on the zombies before they reach Einstein. There are also 2 different weapons to be chosen (I'll put a cooldown later).
My problem is: there are lots of zombies spawning on both sides of the screen, and the spawn rate grows when the player scores. Sometimes, one or more zombise stay in front of another ones, making like a "pile" of zombies. When I click to kill, they ALL get killed instead of just the one that is on the top.
How can I make the game kill only the top zombie?
Game link: http://arcade.gamesalad.com/g/116376
Thanks in advance for your help.
In this game, you must click on the zombies before they reach Einstein. There are also 2 different weapons to be chosen (I'll put a cooldown later).
My problem is: there are lots of zombies spawning on both sides of the screen, and the spawn rate grows when the player scores. Sometimes, one or more zombise stay in front of another ones, making like a "pile" of zombies. When I click to kill, they ALL get killed instead of just the one that is on the top.
How can I make the game kill only the top zombie?
Game link: http://arcade.gamesalad.com/g/116376
Thanks in advance for your help.
Comments
Dwarf Miner
http://forums.gamesalad.com/search?search=Destroy+top+layer
I searched on the link, also on youtube videos and some other internet tutorials, but I couldn`t make any one of them to work. When I click to kill overlapping zombies, they all get destroyed at the same time. I wasn`t able to solve this.
Do anyone have any suggestion?
https://www.dropbox.com/sh/by86wpt38954em7/pBaM3k1t89
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Here is my file again
https://www.dropbox.com/s/ki4oq872lyahh7k/prototypetest.zip
https://www.dropbox.com/s/mhiwcqnhi7b9fn2/prototypetry2.zip
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The changes worked when there is just only one zombie on the screen. When I start to spawn zombies 2, 3 and 4, the things go wrong.
The first time, I got a delay on click+damage+destroy. There was a delay of 0.5 to 1 second before the zombie got destroyed.
Then, with more zombies on the screen, I was able to just kill some of the zombies, and just the ones that were on the botton layer.
https://www.dropbox.com/s/il902qqs12ehvwg/prototypetry3.zip
I'll take a look when I get a chance later.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://www.mediafire.com/download/ktne3dd9afrd9b8/DestroyTopActor.zip
I added a spawner with Layer Order set to front of layer and it works beautifully.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I think its funny when people get frustrated about how they need to make 'workarounds' to get GameSalad to do what they want. In reality, GameSalad's extreme flexibility is its greatest strength. (Not that anyone is complaining in this thread. I just meant in general.)
Just seeing that joints video blew my mind, for example.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
If you liked the joints video then you will hopefully like the little Christmas gift I have prepared for the GameSalad community! If you want it, I can pm you a copy of an early prototype.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@carecuxo -- hopefully the demo above will give you a feel for what to do. Feedback on whether it works for you is always appreciated.