aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/game/world.tm4
-rw-r--r--examples/log/log.tm8
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/game/world.tm b/examples/game/world.tm
index 4df7f156..a28fe987 100644
--- a/examples/game/world.tm
+++ b/examples/game/world.tm
@@ -57,11 +57,11 @@ struct World(player:@Player, goal:@Box, boxes:@[@Box], dt_accum=0.0, won=no):
# Resolve player overlapping with any boxes:
for i in 3:
- for b in w.boxes[]:
+ for b in w.boxes:
w.player.pos += STIFFNESS * solve_overlap(w.player.pos, Player.SIZE, b.pos, b.size)
func draw(w:@World):
- for b in w.boxes[]:
+ for b in w.boxes:
b:draw()
w.goal:draw()
w.player:draw()
diff --git a/examples/log/log.tm b/examples/log/log.tm
index 89557e55..5e32a2b9 100644
--- a/examples/log/log.tm
+++ b/examples/log/log.tm
@@ -17,22 +17,22 @@ func _timestamp(->Text):
func info(text:Text, newline=yes):
say("$\[2]⚫ $text$\[]", newline)
- for file in logfiles[]:
+ for file in logfiles:
file:append("$(_timestamp()) [info] $text$\n")
func debug(text:Text, newline=yes):
say("$\[32]🟢 $text$\[]", newline)
- for file in logfiles[]:
+ for file in logfiles:
file:append("$(_timestamp()) [debug] $text$\n")
func warn(text:Text, newline=yes):
say("$\[33;1]🟡 $text$\[]", newline)
- for file in logfiles[]:
+ for file in logfiles:
file:append("$(_timestamp()) [warn] $text$\n")
func error(text:Text, newline=yes):
say("$\[31;1]🔴 $text$\[]", newline)
- for file in logfiles[]:
+ for file in logfiles:
file:append("$(_timestamp()) [error] $text$\n")
func add_logfile(file:Path):