How do I make fall damage?

Get help using Construct 2

Post » Sun Feb 14, 2016 9:34 pm

Well, as simple as the title says, how can I make fall damage in a 2d platformer?
B
4
Posts: 17
Reputation: 232

Post » Sun Feb 14, 2016 9:45 pm

Sounds very simple indeed..

Could you explain what fall damage is in your opinion?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 14, 2016 9:49 pm

LittleStain wrote: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?
B
4
Posts: 17
Reputation: 232

Post » Sun Feb 14, 2016 9:51 pm

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
B
29
S
13
G
10
Posts: 355
Reputation: 8,317

Post » Sun Feb 14, 2016 9:53 pm

Carbincopy wrote: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?
B
4
Posts: 17
Reputation: 232

Post » Sun Feb 14, 2016 9:54 pm

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
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 14, 2016 9:56 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 14, 2016 10:06 pm

LittleStain wrote: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.
B
4
Posts: 17
Reputation: 232

Post » Sun Feb 14, 2016 10:07 pm

if player.y less then 200
player is not touching or overlapping object

on collision with ground set damage event
B
29
S
13
G
10
Posts: 355
Reputation: 8,317


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 3 guests