Return to Layout issues

0 favourites
  • 6 posts
From the Asset Store
Game "Little Dino Adventure Returns" with complete Source-Code (Construct3 / .c3p) + HTML5 Exported.
  • Currently in my layout I have the Camera lerping with the character based on what zone he is in. This is creating a problem however.

    I want the character to be able to enter a house, but if I use the "set position" event to move him to another part of the layout for the houses interior the camera then scrolls to that area, which I do not want.

    So, I decided to make the house interior on its own layout, and simply have it so when the Character hits the house door it sends him to the House interior layout.

    But, when he leaves and comes back to the layout, the character then goes back to the original start position of the original layout.

    My brain is fried, does anyone have any ideas to either get rid of the scrolling camera issue, or set the position of the character to outside of the house when he returns to the original layout?

  • Use dictionaries they are layout independent and can store variables throughout your project. Let your brain rest a bit <img src="smileys/smiley17.gif" border="0" align="middle">

    note that the trigger has 3 image points because why use more triggers when you can use more image points xD.

    Small capx example made for you Hexxiss

  • cooooool I always thought the dictionary was just for spelling check in word games

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Dictionary is for saving pairs of "key" -> "value" for whatever you want.

  • Instead of lerping to character, use the scroll to behavior. This will eliminate the scrolling while changing layout position issue.

    As for saving the character's position, create two globals

    playerX

    playerY

    At end of layout, set playerX to player.X and set playerY to player.Y. When character reenters layout, set position to playerX, playerY

    good luck

  • Thank you all, especially MrPeanut for taking the time to help answer all those questions! I love the community on here, you're always a great help!

    And great suggestion Pappapuck, on the globials! I may have to give that a try also. I tweaked what Mr Peanut suggested, and it seems to be working great for now!

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