Jigoku / boxclip

2D platformer engine using LÖVE and Lua
https://jigoku.github.io/boxclip/
GNU General Public License v3.0
94 stars 8 forks source link

Reset certain entities when off-screen by a set distance #71

Open Jigoku opened 8 years ago

Jigoku commented 8 years ago

Problem: If a player activates falling logs, and then backtracks, they may not be able to complete the level.... so make these reset when off screen.

Jigoku commented 6 years ago

physics.lua

if not world:inview(trap) then
    table.remove(trap, i)
end

change to something like

if not world:inextendedview(trap) then
    trap.x = trap.xorigin
    trap.y = trap.yorigin
    trap.falling = false
end

Although another switch should be added, trap should not infinitely fall. Once off screen in falling state, don't move the undrawn trap.

Jigoku commented 6 years ago

Not much of a problem for now, as mapstates have been implemented (resets everything to checkpoint), removing milestone for now.