How to stop character from falling through map at start - Infinite Jumping

0 favourites
  • 6 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • Hi Everyone,

    I was wondering if anyone can shed some light on how to make the character start at the floor instead of instantly falling through and resetting the game.

    I've changed the events of the game that the player has to press jump instead of automatically jumping. However, I want the player to start on the ground first. Currently the player instantly falls through because there's an event which states when the player falls after the game viewpoint restart.

    I would like to keep that feature but at the start of the game I would like the player to stand and then the player can then press the up arrow to jump (which I've created already) I just need some guidance for the start point.

    Any help would be greatly appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd imagine you could have a Boolean that starts as false, let's call it FallThrough. On your code that makes the player fall and lose, FallThrough has to be true in order to fall and lose. That way, when the game starts, they don't immediately fall and lose.

    When your player first presses the up arrow and FallThrough is false, set FallThrough to true.

    If you use a global variable, make sure you reset FallThrough to false when the player clicks restart.

  • Hi Alex,

    Thanks for the reply.

    I'm slightly confused with the Boolean. Could you give an visual example on how this is setup?

    This is the current code which make the character reset from they fall from the viewpoint of the game. So at the start of the game the character immediately falls through. I tried using a Spirit (Platform) to stop this and it works. But it seems to cause jumping issues.

    If you could help explain how to add the boolean to my setup would be greatly appreciated.

  • Oh, I see.

    Let me clarify, you want your player to start standing on a sprite with the solid behavior, yes? Then the player jumps from that platform to start the game?

  • Ohh it's that simple haha.

    Thanks for the help it worked.

    Sorry I'm new to construct so I'm just playing around with everything.

  • No worries, everyone starts somewhere.

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