UUpdate Tutorials

This commit is contained in:
2026-10-25 12:43:53 -07:00
commit cd94bb4ba8
32 changed files with 1077 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package lnx;
class Player2Controls extends iron.Trait {
public function new() {
super();
notifyOnUpdate(function() {
var keyboard = iron.system.Input.getKeyboard();
var tank = object.getTrait(TankTrait);
if (keyboard.down("a")) {
tank.turnLeft();
}
if (keyboard.down("d")) {
tank.turnRight();
}
if (keyboard.down("w")) {
tank.forward();
}
if (keyboard.down("s")) {
tank.backward();
}
});
}
}