mirror of
https://github.com/kristoferssolo/maze-ascension.git
synced 2025-10-21 19:20:34 +00:00
fix(player): spawn position
This commit is contained in:
parent
30d6cf5fba
commit
b89921dcd6
@ -17,12 +17,15 @@ pub fn spawn_player(
|
|||||||
let player_height = maze_config.height * 0.5;
|
let player_height = maze_config.height * 0.5;
|
||||||
let player_radius = maze_config.hex_size * 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((
|
commands.spawn((
|
||||||
Name::new("Player"),
|
Name::new("Player"),
|
||||||
Player,
|
Player,
|
||||||
CurrentPosition(Hex::new(1, 1)),
|
CurrentPosition(start_hex),
|
||||||
Mesh3d(meshes.add(generate_pill_mesh(player_radius, player_height / 2.))),
|
Mesh3d(meshes.add(generate_pill_mesh(player_radius, player_height / 2.))),
|
||||||
MeshMaterial3d(materials.add(blue_material())),
|
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),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user