After playing with the code and testing the results of swapping the order it became clear why this order was used:
impl GameState for State {
fn tick(&mut self, ctx: &mut BTerm) {
ctx.cls();
self.player.update(ctx, &self.map);
self.map.render(ctx);
self.player.render(ctx);
}
}
instead of this order, which renders the player before the map:
impl GameState for State {
fn tick(&mut self, ctx: &mut BTerm) {
ctx.cls();
self.player.update(ctx, &self.map);
self.player.render(ctx);
self.map.render(ctx);
}
}
Suggestion: Perhaps add a short note to indicate that the order of the steps is important (though it may be implied).