cleanup
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ use bevy::prelude::*;
|
|||||||
#[require(Transform)]
|
#[require(Transform)]
|
||||||
pub struct Cursor {}
|
pub struct Cursor {}
|
||||||
|
|
||||||
pub fn setup_curor(mut commands: Commands, asset_server: Res<AssetServer>) {
|
pub fn setup_cursor(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
Transform::from_xyz(0., 0., 10.).with_scale(Vec3::splat(PIXEL_RATIO)),
|
Transform::from_xyz(0., 0., 10.).with_scale(Vec3::splat(PIXEL_RATIO)),
|
||||||
Sprite {
|
Sprite {
|
||||||
|
|||||||
+12
-5
@@ -24,15 +24,22 @@ fn main() {
|
|||||||
.set(ImagePlugin::default_nearest()),
|
.set(ImagePlugin::default_nearest()),
|
||||||
)
|
)
|
||||||
.insert_resource(ClearColor(Color::srgb(0.0, 0.0, 0.0)))
|
.insert_resource(ClearColor(Color::srgb(0.0, 0.0, 0.0)))
|
||||||
.add_systems(Startup, (game::setup_level, camera::spawn_panning_camera))
|
.add_systems(
|
||||||
|
Startup,
|
||||||
|
(
|
||||||
|
game::setup_level,
|
||||||
|
camera::spawn_panning_camera,
|
||||||
|
cursor::setup_cursor,
|
||||||
|
),
|
||||||
|
)
|
||||||
.add_systems(PostStartup, tile::tile_sprite_occlusion)
|
.add_systems(PostStartup, tile::tile_sprite_occlusion)
|
||||||
.add_systems(Startup, cursor::setup_curor)
|
|
||||||
.add_systems(
|
.add_systems(
|
||||||
FixedUpdate,
|
FixedUpdate,
|
||||||
(
|
(
|
||||||
camera::camera_movement,
|
camera::camera_movement,
|
||||||
citizen::citizen_movement,
|
citizen::citizen_movement,
|
||||||
tile::tile_item_sprite_update,
|
tile::tile_water_update,
|
||||||
|
cursor::move_cursor,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.init_resource::<tile::CameraMoved>()
|
.init_resource::<tile::CameraMoved>()
|
||||||
@@ -40,9 +47,9 @@ fn main() {
|
|||||||
FixedUpdate,
|
FixedUpdate,
|
||||||
(
|
(
|
||||||
tile::camera_z_movement,
|
tile::camera_z_movement,
|
||||||
tile::tile_sprite_occlusion.run_if(|camera_moved: Res<tile::CameraMoved>| camera_moved.0),
|
tile::tile_sprite_occlusion
|
||||||
|
.run_if(|camera_moved: Res<tile::CameraMoved>| camera_moved.0),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.add_systems(FixedUpdate, cursor::move_cursor)
|
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -42,10 +42,11 @@ pub struct WallTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct WaterTile {
|
#[require(Tile)]
|
||||||
pub tile: Tile,
|
pub struct HasWater {
|
||||||
pub swimmable: bool,
|
pub height : u8,
|
||||||
pub astarmultiplier: f32,
|
pub astarmultiplier: f32,
|
||||||
|
pub swimmable: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
|
|||||||
Reference in New Issue
Block a user