hey, i have been trying for days to make a locked door in my platform game I am making using Game factory 1.
I tried to make the key and the door an active object. But the character walks through the door regardless of the key.
any suggestions would be kind
thank you
I'm not sure what code to put in.
So far for the door I have set the position in relation to my character.
For the key I have set it so it activates the key icon. That seems to work. the key is set to destroy.
The problem is the character just wipes the door out when it passes through.
Anyways, here's what you could do. First off, at the start of the level, set the door's alterable value A to 0. Then, when the player has the key, set alterable value A to (any number besides 0, but we'll go with 1).
Now for the collision. If the door's alterable value A = 0, and player collides with the door, then the player will bounce.
Here's how it works. Basically, you've made the door's Alterable Value A like an on/off switch. When the player picks up the key, it switches alterable Value A to 1, which basically means you can unlock the door now. But if you don't have the key, it stays at 0, which means you can't pass.
Anyways, here's what you could do. First off, at the start of the level, set the door's alterable value A to 0. Then, when the player has the key, set alterable value A to (any number besides 0, but we'll go with 1).
Now for the collision. If the door's alterable value A = 0, and player collides with the door, then the player will bounce.
Does TGF have flags? I know MMF does
Anyway, flags are the real on/off switches of the programming world. Turn Flag 1 on when the player has the key. Turn it off when they lose it. Then if Flag 1 is on when they overlap the door, it opens.
It's pretty much the same thing as what werewoof wrote, but it's a bit simpler that tway.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Poobical Has some jaffa cakes in his coat pocket 3
Registered 27/11/2008
Points 54
28th June, 2009 at 14:11:22 -
TGF has values. Three per active object. Use them as the flags.
Very usual thing helps with enemy health lol.
Your graphics remind me of Dizzy for some strange reason, which is a awesome thing.
I used to use TGF for all my graphics and port them to MMF, too. But then I got into GraphicsGale and now I'm just extremely comfortable using that instead.
So TGF doesn't have a lot of use for me at the moment But I will probably open it up later on for some nostalgia and maybe to make a really simple game, I've done that a few times.
I used to like TGF's interface, but I've gotten used to MMF2's now and personally, I like it more. TGF's interface just scares me now. Oh well, times change.
As for gfx, I do all em all in MMF2.
Askalarium: No problem.
Muz: Oh yeah, flags would be easier. I probably wasn't thinking about them atm or something.