generated from 2ndbeam/bevy-template
fix: Door sprite is facing right direction
- Moved doors closer to center
This commit is contained in:
parent
bb357d8062
commit
3dde5a729e
1 changed files with 9 additions and 5 deletions
|
|
@ -135,7 +135,11 @@ fn door_bundle(image: Handle<Image>, position: Vec2, facing_left: bool) -> impl
|
||||||
Transform::from_xyz(0., 0., 0.),
|
Transform::from_xyz(0., 0., 0.),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
Sprite::from_image(image),
|
Sprite {
|
||||||
|
image,
|
||||||
|
flip_x: facing_left,
|
||||||
|
..default()
|
||||||
|
},
|
||||||
Transform::from_xyz(0., 0., 0.),
|
Transform::from_xyz(0., 0., 0.),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -156,8 +160,8 @@ pub fn setup_world(
|
||||||
asset_server: Res<AssetServer>,
|
asset_server: Res<AssetServer>,
|
||||||
) {
|
) {
|
||||||
let door_image = asset_server.load(DOOR_CLOSED_ASSET);
|
let door_image = asset_server.load(DOOR_CLOSED_ASSET);
|
||||||
commands.spawn(door_bundle(door_image.clone(), vec2(128., 0.), true));
|
commands.spawn(door_bundle(door_image.clone(), vec2(16., 0.), true));
|
||||||
commands.spawn(door_bundle(door_image.clone(), vec2(160., 0.), false));
|
commands.spawn(door_bundle(door_image.clone(), vec2(48., 0.), false));
|
||||||
commands.spawn(door_bundle(door_image.clone(), vec2(196., 0.), false)).insert(Locked);
|
commands.spawn(door_bundle(door_image.clone(), vec2(80., 0.), false)).insert(Locked);
|
||||||
commands.spawn(wall_bundle(vec2(-128., 0.)));
|
commands.spawn(wall_bundle(vec2(-16., 0.)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue