- Problem With My Enemy Gate -

What Is my ‘Enemy Gate?’

My ‘Enemy Gate’ is a gate that the player cannot pass until the Enemy is defeated. It is a tricky one, with a long process, but let me explain what i Did in a Nutshell.

How I did It

First, I coded the Enemy to drop a key when they die. Second, the player gets the value of 2 after collecting the key. Third The enemy Gate Should also get a point each when the player collects a key. Last, if collision with player and Key value = to 1, the gate Should Delete and allow the Player to Pass.

Problem

The Gate. I am sure the Gate is responsible. But the Value is equal to 1. It’s the Collision bit that is not working. Without it, it destroys all the Gates on the Level. I have even swapped Collison with Proximity. I have considered maybe have one at a place in the level and a certain amount of keys is needed to pass forcing the player to kill the majority of enemies they face, but that would not be as good as The Original Plan like on normal Games.

Can I please have Some Help?

http://www.flowlab.io/game/play/1205963

I’m pretty sure there’s a lot simpler way to do it. You could add a health system to the boss, (if you haven’t already done so) then make it so that when his heath reaches 0 it sends a signal to the gate allowing it to open. I’m not sure how exactly you are doing it, but this seems simpler to me in a situation like that.

It’s because your using messages and mailboxes which is going to all gates instead of specific gates.
What you could also do is set up a switch for the delete it-self, turning on before letting it delete .

You could turn the switch on by any action but you could just use a set proximity to the gate to detect the player to turn on. Then getting the key would delete just that gate.