Actor has key or item to open door
butterbean
Member Posts: 4,315
I was reviewing the platformer template on GS, and wanted to know, how can you tell the game that an actor has a key or some item that will allow him/her passage through a doorway, where without the key or item, they cannot pass through.
Comments
But you can always make a game attribute that counts how many keys or which key has been selected to allow gate access.
ref: Gauntlet
Basically, I don't want the actor to have access to the doorway without having touched the key
Create an integer attribute called "keys" which is equal to zero
When "actor" collides with "key A", "keys" = "keys"+1
Destroy "key A"
When "actor" collides with "door A"
If "keys" = 1, open door (destroy the original door actor, and replace it with a non-collidable and immovable image of an open door)
Do this with all the other doors by adding increments of one to the "key" attribute. If the keys can be found in a bunch of different orders, than yeah, like CodeMonkey said, just create a bunch of boolean attributes.