The Daily Click ::. Forums ::. Klik Coding Help ::. Any Help with Making Keys And Doors
 

Post Reply  Post Oekaki 
 

Posted By Message

askalarium



Registered
  05/06/2009
Points
  61
27th June, 2009 at 10:13:40 -

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

Nash*

 
quaz

Carlguy (HTL)

Herbal Tea Lady Productions

Registered
  04/01/2007
Points
  2058
27th June, 2009 at 11:16:21 -

Can you post the code you have now? I take you must have collected the key in order to open the door? Then it should be something like:

Collision between player and door + key has not been destroyed (or key value is 0 or whatever) ---> stop player (or bounce)

Collision between player and door + key has been destroyed (or key value is 1) ----> destroy door (and dont stop or bounce player)

 
...

askalarium



Registered
  05/06/2009
Points
  61
27th June, 2009 at 11:33:23 -

I'm not sure what code to put in.
So far for the door I have set the position in relation to my character.

Image

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.

I'm not sure why this is.

 
quaz

Hayo

Stone Goose

Registered
  15/08/2002
Points
  6946

Game of the Week WinnerHas Donated, Thank You!VIP MemberGOTM 3RD PLACE! - APRIL 2009Weekly Picture Me This Round 27 Winner!Weekly Picture Me This Round 41 Winner!Weekly Picture Me This Round 45 Winner!
27th June, 2009 at 12:04:41 -

Nice graphics there. Could you post a screenshot of what your code looks like now? It's hard to say what is going wrong without seeing the code.

 
www.hayovanreek.nl

askalarium



Registered
  05/06/2009
Points
  61
27th June, 2009 at 12:27:57 -

hey thanks, I have been studying a lot of old pixel art.
Here is the events editor.

Image
hope it helps

 
quaz

Hayo

Stone Goose

Registered
  15/08/2002
Points
  6946

Game of the Week WinnerHas Donated, Thank You!VIP MemberGOTM 3RD PLACE! - APRIL 2009Weekly Picture Me This Round 27 Winner!Weekly Picture Me This Round 41 Winner!Weekly Picture Me This Round 45 Winner!
27th June, 2009 at 12:39:19 -

Is the group "unlock door" set to "active when level starts"?

 
www.hayovanreek.nl

askalarium



Registered
  05/06/2009
Points
  61
27th June, 2009 at 12:42:57 -

No it's deactivated. Do I need to a loop command


 
quaz

Marko

I like you You like you

Registered
  08/05/2008
Points
  2804

Has Donated, Thank You!Game of the Week WinnerVIP Member360 OwnerDos Rules!Happy FellahCrazy EvilI am an April FoolGingerbread House
27th June, 2009 at 18:03:21 -

Off topic slightly, that pic of The Game Factory's event editor was a really nice retro-treat on my eyes!

 
Image

Subliminal Dreams. . ., daily gaming news and the home of Mooneyman Studios!
www.mooneyman-studios.webs.com

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  370

VIP MemberCardboard BoxThe Cake is a Lie
27th June, 2009 at 18:30:50 -

Whoa, TGF WAAAYYYYBACK!

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.

Also yeah, I like your pixel art. Good stuff.

 
n/a

askalarium



Registered
  05/06/2009
Points
  61
28th June, 2009 at 04:33:45 -

awesome that worked a treat thank you.


 
quaz

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
28th June, 2009 at 04:47:47 -


Originally Posted by Mark Radon
Off topic slightly, that pic of The Game Factory's event editor was a really nice retro-treat on my eyes!



Likewise, I was also transported in time back to when I first got TGF

 
n/a

Marko

I like you You like you

Registered
  08/05/2008
Points
  2804

Has Donated, Thank You!Game of the Week WinnerVIP Member360 OwnerDos Rules!Happy FellahCrazy EvilI am an April FoolGingerbread House
28th June, 2009 at 08:50:43 -


Originally Posted by jthongbai

Originally Posted by Mark Radon
Off topic slightly, that pic of The Game Factory's event editor was a really nice retro-treat on my eyes!



Likewise, I was also transported in time back to when I first got TGF


Ha - how was it for you? lol

 
Image

Subliminal Dreams. . ., daily gaming news and the home of Mooneyman Studios!
www.mooneyman-studios.webs.com

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
28th June, 2009 at 09:25:06 -


Originally Posted by W3R3W00F

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.

Image

Poobical

Has some jaffa cakes in his coat pocket 3

Registered
  27/11/2008
Points
  54

360 OwnerVIP MemberLOL SignSnow
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.


Edited by Poobical

 
Image

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
28th June, 2009 at 14:36:16 -

TGF has flags as well. I would join in on the TGF-is-a-throwback thing but I still open it occasionally!

 

  		
  		

Hayo

Stone Goose

Registered
  15/08/2002
Points
  6946

Game of the Week WinnerHas Donated, Thank You!VIP MemberGOTM 3RD PLACE! - APRIL 2009Weekly Picture Me This Round 27 Winner!Weekly Picture Me This Round 41 Winner!Weekly Picture Me This Round 45 Winner!
28th June, 2009 at 16:05:32 -

I still do 90% of my graphics in TGF1

 
www.hayovanreek.nl

Poobical

Has some jaffa cakes in his coat pocket 3

Registered
  27/11/2008
Points
  54

360 OwnerVIP MemberLOL SignSnow
28th June, 2009 at 17:36:02 -

Yeah, TGF interface seems less cluttered and simpler to use. I love making levels in TGF, MMF it gets just too fiddly.

 
Image

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
29th June, 2009 at 02:18:42 -

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.

 
n/a

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  370

VIP MemberCardboard BoxThe Cake is a Lie
29th June, 2009 at 06:08:28 -

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.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click