Door to Door transportation

0 favourites
  • 15 posts
From the Asset Store
Random Maze Generator with Door & Key System - tutorial capx
  • I'm currently working on a puzzle games that take place inside a house with a bunch of doors. I was able to connect Door1 to Door2 with:

    1rst Event

    +Player is overlapping Door 1 and Presses X ----------> Player Set Position (X,Y) Note: (X,Y) is the position of Door 2.

    Now I test it, and it worked. I press X and I get transported from Door 1 to Door 2. Perfect!

    BUT, when I try to repeat the same Event (2nd) but in reverse in order to go back from Door 2 to Door 1, here is when things gets messed up.

    I test it and when I press X in front of Door 2, and I get transported to Door 1, cool so far! But when I press X on Door 1 to go back to Door 2, my Player starts humping the door without going anywhere.

    I really need to advise if I'm doing something wrong or if there's a better way to do a door to door transportation.

    NOTE: All the doors are in the same layout.

  • Is overlapping 1 and press x, set position to (door2.x, door2.y) and vice versa. Is that it? It should be working o-o

    Try uploading your .capx or a print screen with you code so we can have a better understandingo of what's going on.

    Sorry for not being able to help any further

  • Edit: I can't post pictures nor links cuz I don't have rep enough.

    Anyhow, here is exactly how it's written:

    Keyboard - On X Pressed----------------------- Player Set Position to (door2.X, door2.Y)

    Player - Is Overlapping door1

    Keyboard - On X Pressed------------------------ Player Set Position to (door1.X, door1.Y)

    Player - Is Overlapping door2

  • I solve it and it's still strange. The problem was to assign the same key, in this case "X", to both events. What I did was to assign different keys and it worked.

    Still, I'd want to assign just one key to that action because you are just entering a door.

  • If you haven't, I would arrange the events like so

    (Main Event) Press X

    (Sub Event 1) Player overlapping door 1 > [player set position to door2]

    (Sub Event 2) Player overlapping door 2 > [player set position to door1]

    You'll probably want to tweak this because this won't work if you have multiple doors that you are pressing "X" over (use instance variables or something).

  • The events fire so fast so it's like you are at both doors at the same time when you press x. So if you press x at door one you immediatly teleports to door two and the x trigger is still active and you teleport back to door 1 so fast it looks like a glitch

    try this

    Is overlapping and press x > wait 0.05sek > move to other door

    That should work

    And the press part should be a trigger not a condition off course

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OMG! You did it, Anonnymitet! That was the solution. Thank you very much!

  • BTW, maybe you can help me on this problem I have.

    I have set an event that makes my Player set a CRAWLING animation when he overlaps an invisible wall. So every time my Player overlap it, my Player switches from Standing animation to Crawling animation so he can pass through a tunnel. However, if I press up during this animation my Player still jumps. Is there a way for me to disable to "up" key during the crawling animation?

  • Glad it worked.

    For the crawling. Just put conditions on the jump event.

    On up key pressed and is not playing crawling animation as a condition > then jump

    Put the condition "is playing" animation crawling there and right click and inverse it to make it "is not playing" the crawling animation

  • Makes total sense. I'll try it as soon as I get home.

    This is the last favor, I don't want to take much of your time. Do you know of any tutorial that teaches picking objects from the floor and grabbing them, running around the house with them and droping the object on the floor if you want so you can grab another one?

  • That one can be solved in so many ways depending on what type of game it is. You can change animtaion holding the object and you can pin the object to the characters hand. So there are many ways of solving it.

    But for example. You can have the object laying on the floor and when player overlaps it and you press "a" the object gets pinned to the character and you can walk around with it. And when you drop it you simply unpin it and it stays where you left it.

    I do not know any specific tutorial about this. Sorry.

  • One of the many examples of picking up guns to be found by using the search function..

  • How would you guys approach having multiple portals?

    I have my guy if he is overlapping portal A pick portal B with same instance variable which i call portalNumber then send guy to that portal b. This sounds easy enough but it doesnt work for me. Any ideas?

  • why dont u do when ( player collide with the door ) destroy the player ! then create the player on another door

  • The problem is picking the door with the same variable number.

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