First you need to choose what type of object you need.
class myGameObject extends JSGL.GAME_OBJECT {}
class MovingRect extends JSGL.Shape { Start(){ this.transform.set(game.GetRandomPosition()); this.properties.color = 'red'; this.properties.border = true; this.properties.borderColor = 'black'; } Update(event){ this.transform.translate(this.transform.forward.multiply(event.deltaTime)); } OnMouseClick = () => JSGL.log('mouse click'); OnMouseDown = () => JSGL.log('mouse down'); OnMouseUp = () => JSGL.log('mouse up'); OnMouseHoverStart(){ JSGL.log('mouse hover start'); this.properties.color = 'blue'; } OnMouseHoverEnd(){ JSGL.log('mouse hover end'); this.properties.color = 'red'; } }
There was an error while loading. Please reload this page.