Skip to content

Commit

Permalink
New sprites and test level fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
rewin123 committed Dec 6, 2023
1 parent f738a61 commit 488b110
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
Binary file modified assets/test/dog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/test/sheep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ fn main() {
..default()
}),
..default()
}))
}).set(
ImagePlugin::default_nearest(),
))
.insert_resource(DirectionalLightShadowMap { size: 4096 })
.add_plugins(GamePlugin)
.add_systems(Startup, set_window_icon)
Expand Down
2 changes: 1 addition & 1 deletion src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn spawn_player_by_event(
material: material.clone(),
transform: Transform::from_translation(event.position)
.with_rotation(get_sprite_rotation())
.with_scale(Vec3::splat(1.0)),
.with_scale(Vec3::new(12.0 / 8.0, 1.0, 1.0)),
..default()
},
Player,
Expand Down
4 changes: 2 additions & 2 deletions src/sheep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn setup(
});

//spawn sheeps
let r = TEST_LEVEL_SIZE / 2.0;
let r = TEST_LEVEL_SIZE / 1.5;
let mut rng = rand::thread_rng();
let sheep_count = 100;

Expand All @@ -129,7 +129,7 @@ pub fn setup(
material: sheep_material.clone(),
transform: Transform::from_xyz(pos.x, pos.y, pos.z)
.with_rotation(get_sprite_rotation())
.with_scale(Vec3::splat(1.0)),
.with_scale(Vec3::new(13.0 / 10.0, 1.0, 1.0)),
..default()
},
Sheep,
Expand Down
9 changes: 7 additions & 2 deletions src/test_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const TREE_PATH: &str = "test/pine.png";

pub const TEST_LEVEL_SIZE: f32 = 20.0;

pub const DAY_SUN_COLOR: &str = "f2ecbe";
pub const EVENING_SUN_COLOR: &str = "cfaf56";
pub const DUSK_SUN_COLOR: &str = "f2ecbe";
pub const NIGHT_SUN_COLOR: &str = "f2ecbe";

pub fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
Expand Down Expand Up @@ -37,7 +42,7 @@ pub fn setup(
transform: Transform::from_xyz(30.0, 30.0, 30.0).looking_at(Vec3::ZERO, Vec3::Y),
directional_light: DirectionalLight {
shadows_enabled: true,
color: Color::WHITE,
color: Color::hex(DAY_SUN_COLOR).unwrap(),
illuminance: 50000.0,
..default()
},
Expand Down Expand Up @@ -103,7 +108,7 @@ pub fn setup(
..default()
})),
material: materials.add(StandardMaterial {
base_color: Color::rgb(0.0, 0.5, 0.0),
base_color: Color::hex("5d9669").unwrap(),
..default()
}),
transform: Transform::from_xyz(0.0, 0.0, 0.0),
Expand Down

0 comments on commit 488b110

Please sign in to comment.