0 Favourites

Open World Level/Layout change

  • Hi there,

    I am fairly new to C2 but not new to game development at all. I read a few tutorial and made a few test games and everything works fine so far.

    Since I am experienced in other engines and game design in general I figured I try a project of mine I had in my head for a while. It's a small open world game. And so far everything worked exactly the way it should. My layouts load, the player moves in between them and everything looks very nice.

    Until I started to create multiple doors into different parts of the same layout.

    You see, I figured I measure the X and Y cooridnates of the door to determine what door it is. This is then stored in a global variable. So if the player goes through a door, the variable is read and puts the player to the correct position. And this works exactly as I want it to - with ONE flaw: The player is kinda stuck in a jumping up and down motion and cant get to anywhere.

    Now of course I tried to find the problem. So I removed the "Set Position" aspect of the events and all of a sudden changing layouts works asit should. But I need to set the player to the correct position of course, otherwise it won't make much sense to have multiple doors into a layout.

    So now I need help to fix my jumpy problem. Here is how my event sheet is set up for that file:

    <img src="http://www.ezekiel-rage.com/images/problem.png" border="0" />

    If I remove the red circled part, the level changing works. The way its now the player seems to be stuck in a falling/jumping loop but cant move.

    Any ideas?

    Thanx!

  • Does your layout share the same event sheet? If yes, is your DoorVariable a global variable? If it is then it will keep setting your PlayerBox to position 722,689 every tick.

    You can try setting DoorVariable to 0 after set position.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • That exactly did the trick. Works flawless now. Thank you very much for your quick help :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
392 34,839
Joannesalfa's avatar
Joannesalfa
Unread hot topic Locked topic
195 16,205
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
89 11,367
thehen's avatar
thehen