How do I create a good key and door system

Get help using Construct 2

Post » Sun Mar 02, 2014 8:41 pm

Hello guys,
I am finally getting a chance to try out C2! I am loving it so far. I am sorry if this question in the wrong thread, please let me know if it is so I can correct the problem.

My question involves locks and keys. The method I have set up now goes like this: player runs into the key, key gets destroyed and +1 to my global variable named "Key". However now i cannot figure out how to transfer that global variable into something allowing the player to open the door at the end of the level.

I am excited to jump into the community because i am loving the software so much. Thanks guys! :D
B
3
Posts: 6
Reputation: 187

Post » Sun Mar 02, 2014 8:43 pm

Use System -> Compare variable.

Like this:
Variable key is equal to 1 -> Door collision disabled (or whatever way you use to set door open)
B
16
S
5
G
4
Posts: 74
Reputation: 3,311

Post » Sun Mar 02, 2014 8:47 pm

You could put three conditions (lets say x is a button for opening doors)

System/key=1 > open dors or any action that involves opening doors
Player is overlapping/doors
On x button is down
B
7
S
2
Posts: 102
Reputation: 975

Post » Sun Mar 02, 2014 8:48 pm

Thanks for the quick response Sollaano...I will try that!
B
3
Posts: 6
Reputation: 187

Post » Sun Mar 02, 2014 8:49 pm

Oh that was helpful Berserky, thanks!
B
3
Posts: 6
Reputation: 187

Post » Sun Mar 02, 2014 8:51 pm

No problem thats the way i open chest in my game XD
B
7
S
2
Posts: 102
Reputation: 975


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests