better var name, reduce debug logging

This commit is contained in:
Roberto Maurizzi 2025-07-17 16:52:48 +08:00
parent e4521e2e0c
commit 046cc8dba8
Signed by: robm
GPG key ID: F26E59AFAAADEA55

View file

@ -78,7 +78,7 @@ fn apply_movement(
// no velocity... for now? It'd be nice to have different speed depending on the tile type
// let velocity = controller.max_speed * controller.intent;
for mut player_grid_coords in players.iter_mut() {
for mut player_abs_coords in players.iter_mut() {
let movement_direction = if controller.intent.x == 1.0 {
GridCoords::new(1, 0)
} else if controller.intent.x == -1.0 {
@ -95,14 +95,14 @@ fn apply_movement(
warn!("Unrecognized intent: {:?}", controller.intent);
return;
};
info!("player old coords: {:?}", player_grid_coords);
let destination = *player_grid_coords + movement_direction;
info!("player old absolute coords: {:?}", player_abs_coords);
let destination = *player_abs_coords + movement_direction;
info!("commanded movement player coords: {:?}", destination);
info!("Level selection: {:?}", level_selection_iid);
debug!("Level selection: {:?}", level_selection_iid);
if !level_walls.in_wall(level_selection_iid, &destination) {
*player_grid_coords = destination;
info!("new player grid_coords: {:?}", player_grid_coords);
info!(
*player_abs_coords = destination;
info!("new player grid_coords: {:?}", player_abs_coords);
trace!(
"new player screen_coords: {:?}",
player_transform_query.single()
);
@ -110,7 +110,7 @@ fn apply_movement(
} else {
info!("SDENG!");
}
level_walls.debug_collisions(level_selection_iid, &player_grid_coords);
level_walls.debug_collisions(level_selection_iid, &player_abs_coords);
}
}
}