Module input improvements

This commit is contained in:
YourWishes committed 2026-04-29 23:40:01 -05:00
1 parent 010900fe21
commit 3d984e13c2
4 files changed
+128 -111

No files matched your search

+3 -4
View File
@@ -12,10 +12,9 @@ Object.assign(CubeEntity.prototype, Entity.prototype);
CubeEntity.prototype.update = function() {
var speed = 3.0;
var dx = inputAxis(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT);
var dz = inputAxis(INPUT_ACTION_UP, INPUT_ACTION_DOWN);
this.position.x += dx * speed * TIME.delta;
this.position.z += dz * speed * TIME.delta;
var move = Input.axis2D(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT, INPUT_ACTION_UP, INPUT_ACTION_DOWN);
this.position.x += move.x * speed * TIME.delta;
this.position.z += move.y * speed * TIME.delta;
this.material.setColor(Color.rainbow());
};