Fix position

This commit is contained in:
2026-04-30 23:18:36 -05:00
parent 03ae83b119
commit 9293aeeec8
5 changed files with 145 additions and 18 deletions
+4 -6
View File
@@ -13,12 +13,10 @@ 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);
var pos = this.position.position;
this.position.position = new Vec3(
pos.x + move.x * speed * TIME.delta,
pos.y,
pos.z + move.y * speed * TIME.delta
);
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());
};