this project is built on LOVE 2d game engine, mainly just to hone skills but it is suitable for use
Install my-project with npm
- create environment
mkdir my-project- clone repo
git clone https://github.com/MythicalMayhem/physicsNgine- install lua and make environment
- install love 2d (how to install)
-
cd my-project - run with
ALT + L
boxes:new (canCollide,x,y,w,h,c)- canCollide : collidable or walk-through
- x,y : position
- w,h : width / height
- c : hitbox color {r,g,b,a} r,g,b,a in [0,1]
entities:new (x,y,w,h,c)- canCollide : collidable or walk-through
- x,y : position
- w,h : hitbox width / height
- c : hitbox color {r,g,b,a} r,g,b,a in [0,1]
physics:applyImpulse(e,x,y,mag,res)- e : the entity (player or npc)
- x,y : coordinates of the normalized vector
- mag : magnitude
- res : resistance, the rate of diminution
physics:linear(e,x,y,mag)- e : the entity (player or npc)
- x,y : coordinates of the normalized vector
- mag : magnitude
local tw = tween:new(obj, { x = fromX, y = fromY }, { x = toX, y = toY }, seconds)tw:pause()tw:resume()tw:destroy()