Physics/platformer

0 favourites
  • 3 posts
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • Hello, I am making a game with similar basics at the Physics - rolling platformer example.

    I quickly came to the conclution that mixing the preprogrammed platform behaviour with the physics behaviour is a fail thing to do...So now im doing it with only physics...

    I think the Physics - rolling platformer example lack one important thing.

    A check for midair, so you cant jump while in the air.

    Does anyone have a good idea how to add such a check to the example?

    Cant seem to figure it out on my own...

  • Make a marker and have it set position to the the players object every tick...

    (you can make it invisible later)

    Resize it so that it sticks out a several pixels underneath the player object.. so it will overlap any floor that the player is standing on.

    Create an instance variable in the player object, call it something like "IsOnFloor"

    Now create an event with three conditions:

    On player collision with ground

    and

    if marker is overlapping ground

    and

    if "IsOnFloor" = 0

    ------------> then set "IsOnFloor" to be 1

    and then another event:

    if marker is not overlapping ground

    and

    if "IsOnFloor" = 1

    -------------->then set "IsOnFloor" to be 0

    So you've probably already guessed the rest.. you have the "IsOnFloor" variable working, just make the player only able to jump if "IsOnFloor" = 1

    hope that helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks alot for the help, it works :D.

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