The Wayback Machine - https://web.archive.org/web/20201118072514/https://github.com/thebracket/rustrogueliketutorial/issues/119
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.9 suggestion - mention draw_map before ranged_target #119

Open
Raymond26 opened this issue Apr 13, 2020 · 0 comments
Open

1.9 suggestion - mention draw_map before ranged_target #119

Raymond26 opened this issue Apr 13, 2020 · 0 comments
Assignees

Comments

@Raymond26
Copy link

@Raymond26 Raymond26 commented Apr 13, 2020

Before 1.9, the last mention of draw_map() and the code below occurs in 1.6 where it is below the delete_the_dead() call.

damage_system::delete_the_dead(&mut self.ecs);

draw_map(&self.ecs, ctx);

let positions = self.ecs.read_storage::<Position>();
let renderables = self.ecs.read_storage::<Renderable>();
let map = self.ecs.fetch::<Map>();

for (pos, render) in (&positions, &renderables).join() {
    let idx = map.xy_idx(pos.x, pos.y);
    if map.visible_tiles[idx] { ctx.set(pos.x, pos.y, render.fg, render.bg, render.glyph) }
}

The setting of backgrounds in ranged_target() gets overwritten by the map drawing/rendering code, and it's not explicitly mentioned in the tutorial that it needs to be moved up to the beginning of tick().. might be helpful add that.

@thebracket thebracket self-assigned this Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.