Alright so I tested it out on my other computer and here is the code that I have:
[lua]
require(“physics”)
physics.start()
local platform = display.newRect(0, ch-50, cw, 50)
physics.addBody(platform, “static”)
local player = display.newRect(cw/2 - 25, 50, 50, 50)
player:setFillColor(100, 100, 100)
physics.addBody(player)
function player:preCollision( event )
local v,y = player:getLinearVelocity()
local damage = 0.2 * y – change 0.2 to change damage value
print("Velocity = ", y)
print("Damage = ", damage)
end
player:addEventListener(“preCollision”)
[/lua]
So basically it creates a preCollision function for the player which gets the linear velocity of him right before he hits the platform. The listener then uses that to calculate an amount of damage to inflict which you can change, maybe depending on what boots he wears. Hope this helps!