aboutsummaryrefslogtreecommitdiff
path: root/examples/game/world.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-08 20:26:33 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-08 20:26:33 -0400
commitba3413a9c91dca356db47e0e8db91216c4e3906b (patch)
tree88a32e1be450b1dc8d7ed3398adde870d132bb50 /examples/game/world.tm
parentf33b7048d7f1255a4f9c04057340f2c71d6fb982 (diff)
Center player
Diffstat (limited to 'examples/game/world.tm')
-rw-r--r--examples/game/world.tm1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/game/world.tm b/examples/game/world.tm
index d921841b..6208d1c5 100644
--- a/examples/game/world.tm
+++ b/examples/game/world.tm
@@ -84,6 +84,7 @@ struct World(player:@Player, goal:@Box, boxes:[@Box], dt_accum=0.0, won=no):
(&w.boxes):insert(box)
else if cell == "@":
pos := Vec2((Num(x)-1) * box_size.x, (Num(y)-1) * box_size.y)
+ pos += box_size/2. - Player.SIZE/2.
w.player = @Player(pos,pos)
else if cell == "?":
pos := Vec2((Num(x)-1) * box_size.x, (Num(y)-1) * box_size.y)