Tutorial Downloads

File Size


Know another language? Translate this tutorial!

platform falling damage

Favourite 6 favourites
Tutorial written by ffman22Originally published on 16th, April 2017

this is a simple tutorial for a falling damage, using distances, because with the method of counting the time when you falling, can be affected by the frame rate of the game, with this method, the fall distances calculation will not affect by the frame rate.

first we need to create 3 global variables.

1- iY or initial Y, this is the player y postion when you start to falling.
2- eY or end Y, this is the player y position when touch the floor.
3- max_distance.

I am using the platform templete of C2.

now we create 2 events.

first event.

player--Platform On fall===== set iY to player.Y

second event.

player--Platform On landed===== Set EY to player.Y
subevent--system max_distance<or=int(distance(0,IY,0,EY))=====do the damage event.

Unlock your full gamedev potential

Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!

View deals

Plus, it's got a lot of additional features that will help you save time and make more impressive games!

Congratulations on finishing this tutorial!

Did you learn a lot from it? Share it now with your friends!

Share and Copy this Tutorial

You are free to copy, distribute, transmit and adapt this work with correct attribution. Click for more info.

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.