Files
Leenkx_Examples/game_bowling/Sources/lnx/PinTrait.hx
2026-05-06 17:52:45 -07:00

25 lines
331 B
Haxe

package lnx;
class PinTrait extends iron.Trait {
public static var pinsRemoved = 0;
public function new() {
super();
pinsRemoved = 0;
notifyOnUpdate(function() {
if (object.transform.loc.z < - 20) {
object.remove();
if (++pinsRemoved >= 10) {
leenkx.system.Event.send("exit");
}
}
});
}
}