To clarify:
Here's some code
Code: Select all
if(self.y>=400-self.h)then --if y is greater than the ground height
self.yvel = 0
self.y = 400 - self.h
self.onGround = true
else
self.y = self.y + (self.yvel * dt)
self.yvel = self.yvel + 9.8
end