forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
24
game_bowling/Sources/lnx/PinTrait.hx
Normal file
24
game_bowling/Sources/lnx/PinTrait.hx
Normal file
@ -0,0 +1,24 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user