It currently only supports circle objects and rectangle objects (bummer )
A world is already created upon using the library.
Usage:
Circle:
Code: Select all
physics.newCircleObject(x, y, body, name, size, density, restitution)
@param: x: x position of the circle object
@param: y: y position of the circle object
@param: body: body type of the circle object (ex. "dynamic")
@param: name: name of the circle object (used to draw the object)
@param: size: size of the circle object
@param: density: density of the circle object
@param: restitution: restitution of the circle object (bounciness)
@returns: new circle object
Rectangle:
Code: Select all
physics.newRectangleObject(x, y, body, name, size1, size2, density, restitution)
@param: x: x position of the rectangle object
@param: y: y position of the rectangle object
@param: body: body type of the rectangle object (ex. "dynamic")
@param: name: name of the rectangle object (used to draw the object)
@param: size1: size 1 of the rectangle object
@param: size2: size 2 of the rectangle object
@param: density: density of the rectangle object
@param: restitution: restitution of the rectangle object (bounciness)
@returns: new rectangle object
Draw circle:
Code: Select all
physics.drawCircleObject(mode, name, r, g, b)
@param: mode: how to draw the circle object (ex. "line")
@param: name: name of which circle object to draw
@param: r: red color code
@param: g: green color code
@param: b: blue color code
Draw rectangle:
Code: Select all
physics.drawRectangleObject(mode, name, r, g, b)
@param: mode: how to draw the rectangle object (ex. "line")
@param: name: name of which rectangle object to draw
@param: r: red color code
@param: g: green color code
@param: b: blue color code
==--------------------------------------------------==