0 Favourites

Getting screen transitions right

This forum is currently in read-only mode.
  • I'm trying to get a player character from 1 layout to the next. When I try to adjust the position of the player to the correct entry-point of the layout, he spontaneously teleports to somewhere out of the screen. It's all very frustrating, and I can't figure out what I'm doing wrong.

    Please help

    Cap can be found here: http://www.mediafire.com/?9smh6a324ib39io

  • I got it working. For some reason construct messed up. I closed the file, deleted the persist file, and reloaded the project, and now it works.

    Has anyone else had a similar problem?

  • Maybe I didn't understand you right, but I had no problems with you cap. If I set e.g.

    +Blobby: Value "from_Layout" equal to "Layout 1"

    ->Blobby: Set X to 0

    ->Blobby: Set Y to 1930

    Blobby appears exactly there.

    EDIT: Ok, sry, you already did it

  • Thanks anyway, tulamide.

    Of course, according to sod's law, the problem is back, and deleting the persist file won't help this time.

  • I have the strangest thing going on. In the cap posted in my first post, when I jump to the next screen, all is well, but when I walk off the screen, the player character tends to teleport to a random off-screen location.

    Is it just me, or can anyone else reproduce this?

  • your two layouts are different heights.

    Since the second layout is taller and Construct counts position from the top as zero, you might want to adjust height accordingly.

    Change this in layout 1's events:

    + Blobby: On collision between Blobby and Gateway_forest

    -> Blobby: Set 'from_layout' to "Layout 1"

    -> System: Go to layout "Layout 2" with transition "None" lasting 0 MS

    -> Blobby: Set Y to LayoutHeight - Blobby.Y <------- I ADDED THIS

    Change this in layout 2's events:

    + System: Start of layout

    -> Blobby: Set Y to layoutheight - Blobby.Y <---- I ADDED THIS

    + Blobby: Value 'from_layout' Equal to "Layout 1"

    • > Blobby: Set X to 0
    • > Blobby: Set Y to Blobby.Y +1520
    • > Text: Set text to "X " & int(Blobby.X )
    • > Text2: Set text to "Y " & int(Blobby.Y )
    • > Blobby: Set XY to {0 ,Blobby.Y + 1000 }

    Edit: this changes vertical coordinate to be relative from the bottom when leaving the layout, then uses that value to get the proper Y coordinate to start from in the next layout.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Madster, you're a genius. It finally seems to work consistently. Thank you very much.

  • Glad I could help =)

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