Latest batch of observations…
hands-on-rust_B3.0.pdf
p173: instructions
it is unclear what impl to add get_pathing_distance code snippet to. Since we were last working on BaseMap I assume we are adding it to BaseMap impl.
p176,177 Chasing the Player
This is a rust-noob issue: It took me a while to figure out why/where my braces were not balanced here.
The code snippets do not show the closing braces on the .for_each (in the movers chain of functions)
Because there are several snippets in the chasing system, I had to review back a few pages to figure out what I had missed (nothing, it turns out)
p180 typo
let’s handle
“…the situation gracefully by adding a a state to indicate…”
p180 typo
“Let’s start by fixing the end_game system.” Should be end_turn system.
p181 typo
Indentation off in the body of the end_turn system.
p185 missing code
We add amulet_start to the component struct but there is no instruction to add it to the top of the MapBuilder build fn
pub fn build(rng: &mut RandomNumberGenerator) -> Self {
let mut mb = MapBuilder{
map : Map::new(),
rooms : Vec::new(),
player_start : Point::zero(),
amulet_start : Point::zero(),
};
p:186 code snippet
The following is correct for the game_over function
spawn_amulet_of_yala(&mut self.ecs, map_builder.amulet_start);
But in the new function it looks like it should be
spawn_amulet_of_yala(&mut ecs, map_builder.amulet_start);
p196: ns
“The content of old_comp would become invalid, and the data would exist only in old_comp.”
p202-203: instructions
Text above snippet made it sound like we were adding code.
It was unclear that the renderables iteration shown was to replace the (&Point, &Render)>::query() iteration, but still keeping draw_batch and setting its target and keeping the offset. I figured it out, but it was a bit awkward.
Showing an unchanged line of code above and below the replaced section would help.
p204: instruction
Like last, the instructions made it sound like we were adding code as opposed to replacing code. Showing an unchanged line of code above and below the replaced section would help.
p204: Appearance of hanging
Nothing of particular concern, just an interesting quirk. I played a few games at this point and thought I may have found the game hanging. Turns out I was in a long vertical corridor with some odd visual clues. The fov algorithm has a quirk where in a vertical corridor, walls on either side of the player are visible up to 3 tiles ahead, then not visible 4 tiles ahead, then visible 5 tiles ahead, then not visible for the next few tiles. The same thing happens behind the player. This makes it appear there are side passages and rooms opening up ahead (and behind) but really it is just more corridor. Because the corridor is long, it makes it look like you are stuck and not moving. The first time I saw this I assumed I was hung and closed the game. Of course if you keep moving you eventually see new stuff and that you are not stuck.
I expect this will be less of an issue once we add in the player’s map memory.
Fun!
I am enjoying this. Thanks!