Files
dusk/assets/entities/cube.js
T
2026-04-30 23:34:32 -05:00

22 lines
674 B
JavaScript

function CubeEntity() {
Entity.call(this);
this.add(POSITION);
this.add(MESH);
this.add(MATERIAL);
}
CubeEntity.prototype = Object.create(Entity.prototype);
CubeEntity.prototype.constructor = CubeEntity;
CubeEntity.prototype.update = function() {
// var speed = 3.0;
// var move = Input.axis2D(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT, INPUT_ACTION_UP, INPUT_ACTION_DOWN);
// this.position.position.x += move.x * speed * TIME.delta;
// this.position.position.z += move.y * speed * TIME.delta;
// this.position.rotation.x += 3 * TIME.delta;
// this.position.rotation.z += 2 * TIME.delta;
this.material.setColor(Color.rainbow());
};
module = CubeEntity;