Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local updateMotion = System(
- {"position", "velocity"},
- function (position, velocity, dt)
- local destination = position + velocity * dt
- position.x, position.y = destination:unpack()
- end
- )
- local destroyOffscreen = System(
- {"-destroyOffscreen", "position"},
- function (position, camera, entities, i)
- local sx = camera:cameraCoords(position:unpack())
- if sx < 0 or sx > Const.ScaledWidth then
- table.remove(entities, i)
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement