Skip to content

Instantly share code, notes, and snippets.

@akilism
Created April 16, 2015 02:44
Show Gist options
  • Save akilism/dfee322bb3a87f6cb635 to your computer and use it in GitHub Desktop.
Save akilism/dfee322bb3a87f6cb635 to your computer and use it in GitHub Desktop.
add force and update
function updtm(m)
--if flr(m.pos.y) >= 127 then
-- m.pos.y = 127
-- return l
--end
m.vel = addv(m.vel, m.acc)
m.ang = addv(m.ang, m.vel)
m.pos = addv(m.pos, m.vel)
m.acc = multv(m.acc, 0)
return m
end
function addforce(m, force)
m.acc.x += force.x / m.mass
m.acc.y += force.y / m.mass
return m
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment