Created
April 16, 2015 02:44
-
-
Save akilism/dfee322bb3a87f6cb635 to your computer and use it in GitHub Desktop.
add force and update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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