some auto-refactoring
This commit is contained in:
+16
-4
@@ -1,6 +1,6 @@
|
||||
[world]
|
||||
name = "Kiln Demo"
|
||||
start = "house"
|
||||
start = "start"
|
||||
|
||||
# Named Rhai scripts shared across all boards in this world.
|
||||
# Objects reference a script by name via `script_name`.
|
||||
@@ -26,9 +26,21 @@ mover = """
|
||||
// tick() runs. Queue.length() avoids piling up moves; blocked() avoids walking
|
||||
// into a wall (or another object's already-queued move this tick).
|
||||
fn tick(dt) {
|
||||
if Queue.length() == 0 {
|
||||
move(East);
|
||||
}
|
||||
if Queue.length() == 0 { init(); }
|
||||
}
|
||||
fn init() {
|
||||
move(East);
|
||||
move(South);
|
||||
move(North);
|
||||
move(East);
|
||||
say("Hey!", 0.5);
|
||||
delay(0.5);
|
||||
move(West);
|
||||
move(South);
|
||||
move(North);
|
||||
move(West);
|
||||
say("Ho!", 0.5);
|
||||
delay(0.5);
|
||||
}
|
||||
// Fires when something steps into this object; id is the bumper's object id,
|
||||
// or -1 for the player.
|
||||
|
||||
Reference in New Issue
Block a user