diff options
Diffstat (limited to 'examples/game')
| -rw-r--r-- | examples/game/player.tm | 2 | ||||
| -rw-r--r-- | examples/game/world.tm | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/game/player.tm b/examples/game/player.tm index 3461c6ae..dff95b9d 100644 --- a/examples/game/player.tm +++ b/examples/game/player.tm @@ -27,5 +27,5 @@ struct Player(pos,prev_pos:Vec2): p.prev_pos, p.pos = p.pos, p.pos + World.DT*vel - func draw(p:&Player): + func draw(p:Player): Color.PLAYER:draw_rectangle(p.pos, Player.SIZE) 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) |
