Locked doors

Get help using Construct 2

Post » Tue Jul 30, 2013 11:36 pm

Hey guys, this is my first time posting. I am having trouble finding an answer to this question. How would I make a door that requires a key to open it? The goal is to have the player search one layout for the key, and once it is found, have them go to the locked door. Once the door is unlocked, they go through and enter a new layout. Right now I just have a solid sprite with an on collision effect on it, so when you run into it, you get transferred to the new layout. That's about as far as I got. Any help would be great. Thank you!
B
3
Posts: 3
Reputation: 206

Post » Wed Jul 31, 2013 12:00 am

Add an instance variable to the door of KEYID. When they find the key, you would need to store the id of the key in their inventory. When they try to open the door, if they have that key (id matches) then the door is "open"
B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Wed Jul 31, 2013 12:18 am

Do you have an example? I would kick the door, add an instance variable. Type in KEYID, and would I choose Boolean, Number, Or Text? ANd how would that lock the door. I'm sorry Im such a noob at this..
B
3
Posts: 3
Reputation: 206

Post » Wed Jul 31, 2013 5:32 am

It could be done several ways, here is one example.
B
63
S
24
G
4
Posts: 202
Reputation: 6,864

Post » Thu Aug 01, 2013 1:29 am

Awesome thank you! Is there a place I can see other methods? Just so I can choose the one best for my game? Thank you so much!
B
3
Posts: 3
Reputation: 206

Post » Sat Jul 02, 2016 5:05 pm

I found this useful, but I think the next step would be to add an inventory system.

https://www.youtube.com/watch?v=nvyA5LBBvwE

Also, use save player data as a way to collect items and add a save game feature.
Three years later, I wonder what your game looks like now.
B
15
S
5
G
2
Posts: 164
Reputation: 3,082


Return to How do I....?

Who is online

Users browsing this forum: zenox98 and 1 guest