How do I make fall damage?

0 favourites
  • 9 posts
From the Asset Store
This sound pack features 117 game sounds : Axe,Punch Swing & Hit & Damage. This is a perfect collection for your game.
  • Well, as simple as the title says, how can I make fall damage in a 2d platformer?

  • Sounds very simple indeed..

    Could you explain what fall damage is in your opinion?

  • Sounds very simple indeed..

    Could you explain what fall damage is in your opinion?

    Well, with fall damage I mean that if there is X distance from one place to another, the player doesnt take damage, and if there is B distance, it does take damage, for example, if the player falls from 500 pixels, he doesnt take damage, if he falls from 1000 pixels, he does. Now that I think about it, instead of that, can I make a variable to check how much time the player stays on the air and then for example if he is 3 seconds on the air, subtract 3 from health, and if he is 7 seconds, subtract 7 from health?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • well first you need to deside what your damage is (animation damage, health damage, score damage, death)

    then you set it to on collision with object and at from how high = distance

  • well first you need to deside what your damage is (animation damage, health damage, score damage, death)

    then you set it to on collision with object and at from how high = distance

    Yeah, but how can I calculate the height/distance?

  • You mean something like

    player platform is falling

    every x seconds

    • add x to falldamage

    player on landed

    • player subtract falldamage from player.health
    • set falldamage to 0
  • Also the platform behaviour has a condition on fall start..

    If you get the y-coordinate on that event and the y-coordinate on landed, you'd know the fall distance..

  • You mean something like

    player platform is falling

    every x seconds

    - add x to falldamage

    player on landed

    - player subtract falldamage from player.health

    - set falldamage to 0

    Thank you! Now that I see how it works, its looks much easier.

  • if player.y less then 200

    player is not touching or overlapping object

    on collision with ground set damage event

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