0 favourites
  • 8 posts
From the Asset Store
The package contains 105 sounds This sound library is perfect for voicing mechanical doors in your Sci-Fi game.
  • I am trying to figure out the basics for doors. I am working on a platform game with several doors leading to other layouts (stages, houses, caves etc.).

    Current set up:

    event: door, is overlapping, player, keyboard, A is down,

    action: system, go to (desired layout)

    The problem i am running into is the specific location. sometimes I need the character to go to various locations in the stage. I've tried the "set position to" and listed specific coordinates with no success.

    What combinations am I missing?

    I haven't found any tutorials on this - am I overlooking?

    It seems like this would be a very common feature that I am totally overlooking; like a "door function/action". Maybe it goes by another name other than doors?

    Any wisdom is greatly appreciated!

  • Would it work for you to create a global variable and set it with the door variable and use that to set player position in the next layout?

  • I agree with LittleStain. You should have two variables (pos X & pos Y) and change them accordingly.

  • In the door object create two instance variables as said above one for the new x and the new y location you want to jump to. Then when your person contacts the door access the variables to set the x and y of your player. This way will allow you to have unique locations for every door. As I was learning CS2 basics I used this technique in my project itworked well. My doors are invisible objects all the same. Using an invisible object as your jump to location trigger allows you to have many other visible objects . Like multiple style doors colors and shaper per say. yet keep the code to a minimum because the game is looking to trigger with the invisible object.

  • Justin

    I also had two more instance variables in the trigger object to change the current view. Assuming since you want to move your player to a specific location there is a good chance the view will not be set to follow the player. this way the view will always center on the room in focus but player may appear at any location within that room. such as door on left or right or maybe a door in the center. if you use doors in the middle of a room you may not want the trigger to be collision alone but on collision also check for a specific key press to use the door.

  • Justin

    Here is a demo of my way.

    Instructions use left right arrow to move player press space to use door.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks all for the information. Pennington, you're awesome!

  • You're Welcome Justin Good luck with the rest of your project. I like to give back since this community has given to all of us so much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)