Physic

yeah we've come to that damn thing, maybe you don't like physics so we'll end it all with a simple definition

you only need to set "status:true". other parts are for editing physics

physic: {
    status: true,//set the physic state
    x:5,//You enter how far it should travel at position x
    y:22,//You enter how far it should travel at position y
    gravity:213,//by default gravity is set to 0.3
    xfriction:,//friction at x
    yfriction:,//friction at y
 }

Function

physicout = function(obj,data){
console.log(obj)//the name of the object
if(data.flying) console.log("you are flying")
if(data.top) console.log("now from the top")
if(data.right) console.log("now from the right")
if(data.left) console.log("now from the left")
if(data.bottom) console.log("now from the bottom")
if(data.friction) console.log("now from the friction")
}

Last updated