fix(player): spawn position

This commit is contained in:
Kristofers Solo 2024-12-12 19:33:35 +02:00
parent 30d6cf5fba
commit b89921dcd6

View File

@ -17,12 +17,15 @@ pub fn spawn_player(
let player_height = maze_config.height * 0.5;
let player_radius = maze_config.hex_size * 0.5;
let start_hex = Hex::new(1, 1);
let start_pos = maze_config.layout.hex_to_world_pos(start_hex);
commands.spawn((
Name::new("Player"),
Player,
CurrentPosition(Hex::new(1, 1)),
CurrentPosition(start_hex),
Mesh3d(meshes.add(generate_pill_mesh(player_radius, player_height / 2.))),
MeshMaterial3d(materials.add(blue_material())),
Transform::from_xyz(0., player_height * 2., 0.),
Transform::from_xyz(start_pos.x, player_height * 2., start_pos.y),
));
}