Script improvements

This commit is contained in:
2026-05-17 23:40:42 -05:00
parent 54254348b8
commit ed6c951783
55 changed files with 1467 additions and 1565 deletions
+3 -4
View File
@@ -3,11 +3,10 @@ var OverworldEntity = include('entities/OverworldEntity.js');
function CubeEntity() {
OverworldEntity.call(this);
this.add(MESH);
this.add(MATERIAL);
this.add(RENDERABLE);
this.cubeMesh = Mesh.createCube();
this.mesh.mesh = this.cubeMesh;
this.renderable.mesh = this.cubeMesh;
}
CubeEntity.prototype = Object.create(OverworldEntity.prototype);
@@ -19,7 +18,7 @@ CubeEntity.prototype.update = function() {
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.material.color = Color.rainbow();
this.renderable.color = Color.rainbow();
};
module = CubeEntity;