This commit is contained in:
2022-01-29 21:27:59 +01:00
parent fa71410453
commit ce4eb0b4cf
6 changed files with 480 additions and 450 deletions

View File

@@ -1,6 +1,6 @@
use std::collections::HashSet;
use rltk::{Algorithm2D, BaseMap, FontCharType, Point, RGB, Rltk};
use rltk::{Algorithm2D, BaseMap, FontCharType, Point, Rltk, RGB};
use serde::{Deserialize, Serialize};
use specs::prelude::*;
@@ -128,9 +128,7 @@ impl Algorithm2D for Map {
}
}
pub fn draw_map(ecs: &World, ctx: &mut Rltk) {
let map = ecs.fetch::<Map>();
pub fn draw_map(map: &Map, ctx: &mut Rltk) {
let mut y = 0;
let mut x = 0;
for (idx, tile) in map.tiles.iter().enumerate() {