Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function love.run()
- if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
- if love.timer then love.timer.step() end
- local dt = 0
- return function()
- if love.event then
- love.event.pump()
- for name, a,b,c,d,e,f in love.event.poll() do
- if name == "quit" then
- if not love.quit or not love.quit() then
- return a or 0
- end
- end
- love.handlers[name](a,b,c,d,e,f)
- end
- end
- if love.timer then dt = love.timer.step() end
- local Physics = Physics
- local Physics_Entities = Physics.entities
- local Position_Entities = Position.entities
- local Velocity_Entities = Velocity.entities
- for i = 0, Physics.count - 1 do
- local maxX, maxY = maxX, maxY
- local id = Physics_Entities[i]
- local position = Position_Entities._data[id]
- local velocity = Velocity_Entities._data[id]
- position.x = position.x + velocity.x * dt
- position.y = position.y + velocity.y * dt
- if position.x > maxX or
- position.y > maxY then
- position.x = 0
- position.y = 0
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment