This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package lnx;
class PlayerController extends iron.Trait {
public function new() {
super();
notifyOnUpdate(function() {
var kb = iron.system.Input.getKeyboard();
var x = object.transform.loc.x;
// Move player
if ((kb.down("left") || kb.down("a")) && x > -1.8) {
object.transform.loc.x -= 0.06;
object.transform.dirty = true;
}
if ((kb.down("right") || kb.down("d")) && x < 1.8) {
object.transform.loc.x += 0.06;
object.transform.dirty = true;
}
});
}
}