How do I kill my player? (and restart layout)

0 favourites
  • 3 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hello everyone,

    Please bear with me while I give you the details of my problem. I am creating a jumping platform game similar to the Abduction! World Attack series. I am having the most difficult time killing my player when he falls off the bottom of the screen (just restarting the layout). I can't seem to find the right solutions in the forum elsewhere, but please send me to the right place if I missed something. I am a n00b but I'm a smart n00b and none of the intuitive solutions are working. I'm sure it is a simple fix but I can't seem to find it. Here is what I've tried so far:


    • The Infinite Jump template everyone starts with ( I began with this template but needed to make some changes. First, my levels won't be infinite, they have a fixed height with platforms created manually, not automatically. In this template, he compares Player.Y to ViewportBottom to decide when you "die" a la Doodle Jump. In my version, with the fixed height of the layout, the viewport is actually at the top (and obviously I start playing from the bottom jumping up). So using ViewportBottom creates an endless restart layout loop because my player is starting below the viewport (and as of yet there is no way to change the origin of the layout).
    • I've tried to invert when Player "is visible" - to try to restart the layout when the player is NOT visible. For some reason falling off the bottom of the screen doesn't trigger this event like I expected. It seems to work when it's not inverted though (when Player IS visible --> restart layout, sends it into an infinite loop of restarting because the player starts visible, why won't it work inversely?)
    • I've tried to invert when Player "Is on Screen" for the same effect. Falling off the bottom of the screen doesn't trigger this event either. It just freezes (or endlessly restarts the layout) from the get-go. Makes me wonder if it sees the "screen" as the viewport at the top of the layout as well.
    • Destroying the object (Player) when it leaves the layout is no good because with the Wrap behavior and the very tall layout, falling below the screen still keeps you in the layout.
    • I've tried various methods of getting a global variable to track the Y value of the bottom of the viewable screen to compare to my Player Y, but I can't figure out how to make it work. Maybe there's a way to create an invisible object that tracks the bottom of the screen as I jump up and compare Y values to that? I don't know but any help would be great.


    Sorry to go on and on about this. I'm sure the fix is easy I just can't seem to find the magic button. I have to appeal to your higher wisdom. I've included my .capx for you to take a look at. At the bottom I've toggled off my failed attempts if you want to experiment with them. This is just a portion of a larger game so I apologize if there are artifacts that seem like the don't belong in the project. Don't worry about any of that. I just want my layout to reset when the player misses a platform and falls off the bottom of the screen and I'm stuck!

    Thank you very much for your time and any help you can offer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't open your capx.

    You are using Third party plugin "LiteTween"

    Just add invisible sprite in the bottom of the layout to kill the player when he collide with it.

  • Thanks for the heads up. I tried to update the .capx after removing the LiteTween plugin.

    Any further insight on how to get the invisible sprite to follow us up the layout?

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