Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Open and Close door with key

Kurapikxx
Guest
Quote
2022-01-11 10:55:20

Hey I'm doing game development in school and I need to make a game on Construct 3. I need help with the coding. I been trying to scripted a code that gets the player to the next stage by opening a door by a key but so far my code seems to not be working.

I be thankful for any help


Newbee
Guest
Quote
2022-01-11 13:30:25

Try to ask help in Construct 3 forums


serge
Registered User
Quote
2022-01-11 14:32:43

You asking questions in the wrong forum. Only Coppercube question only here.


just_in_case
Moderator
Quote
2022-01-11 16:47:35

You can use variables for that, you can check the collision or proximitt with the key, if player is in proximitt of the key, then set the variable for example "key_collected" to true.

And you can check that key variable value on proximity or collision with the door.

For example when player is in proximity with door check if a variable has value "key_collected" is equal to true or not. If it is true then open the door and change the level otherwise do something else like show him a text box that reads, "you need to get a key to unlock the door".

Above pseudocode will work with any game engine or any programming language. So it doesn't matter if you are a construct 3 user or Coppercube user or unreal or unity user.

Help will always be given at Hogwarts to those who ask for it.


bob
Guest
Quote
2022-09-02 09:05:26

Thanks, It helped me to create doors in my game.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact