For those that are curious: Jumping in this game is done by checking if the vertical velocity is exactly 0. This provides a simple solution provided there are no sloping surfaces that should be jumped from. The game does not use the physics engine but instead its own collision checking, which explains the support for platforms that can jumped through. This does not allow a player to jump in mid-air, save for one a million chances because of the precision of floating point numbers. Although, if collision is supported in the other direction, e.g. for tunnels, then it might be possible to hold jump to hang from a roof.
It seems a bit odd that it's possible to be on the platforms without standing on them, e.g. with the platforms through the body. How about adding if player.y > platform.y + 0.6 or the like as a check? Low FPS may cause the collision to fail as well as some unpredictability. Might I suggest that you instead store the dt value and update as many times as necessary with some constant dt, e.g.
Code: Select all
local tdt = 0
def update(dt)
tdt = tdt + dt
while tdt >= 0.1 do
dt = 0.1; tdt = tdt - dt
...
end
end
LPCL mostly aims at community projects that are not really owned by anyone in particular or to which anyone may contribute, like a framework for making platformers. I'm not sure you want a personal game under that license since it also allows anyone to change the game and call it the game. At the very least, you'd want to put yourself as community so that you have the final word about what goes into the project.