Here's the prob, i have a game in which the user can change weapons by pressing a different number. in level one i want to have a door which could only be opened with a key but i can't seem to do it!!! please help
Printable View
Here's the prob, i have a game in which the user can change weapons by pressing a different number. in level one i want to have a door which could only be opened with a key but i can't seem to do it!!! please help
I use a variable to do this (open a door with a key)
Example (not real code):
door12key = false;
onGameEvent(take door12key){
door12key = true;
}
if (door12key){
opendoor(door12);
}
thank you
but what's onGameEvent i've haven't used that one yet
Well what you can do is to crate an array which holds all items which you can encounter during the game and which you can pick up. You will need a collision detection as well. example:
You walk arround the maze and you see a key on the floor. You go over it ( collision detection here ) the key disapears (_visible=0) and you change your array in a way that it holds the variable key. You approach the door ( collision detection ) and look in the array to see if the variable key=true there. if its there open the door if not show a msg. like " you need a gold key to open the door".
Same whith the guns which you find in the mase. Just and array variable.
Mad_sci
This will probably sound stupid but i don't understand arrays could u explain them to me or is there a tut that does??
well???
what's an array???