Skip to content

Commit

Permalink
Fixed Update on simulation (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac8668 authored Jan 10, 2024
1 parent 6862454 commit ba5d885
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub struct ActorsPlugin;
impl Plugin for ActorsPlugin {
fn build(&self, app: &mut App) {
app.add_systems(
Update,
FixedUpdate,
(
add_actors
.before(chunk_manager_update)
Expand Down
2 changes: 1 addition & 1 deletion src/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ fn animate_sprite(
pub struct AnimationPlugin;
impl Plugin for AnimationPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, animate_sprite.after(update_player_sprite));
app.add_systems(FixedUpdate, animate_sprite.after(update_player_sprite));
}
}
3 changes: 2 additions & 1 deletion src/chunk_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,8 @@ pub struct ChunkManagerPlugin;
impl Plugin for ChunkManagerPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, manager_setup)
.add_systems(Update, (chunk_manager_update, update_manager_pos))
.add_systems(FixedUpdate, chunk_manager_update)
.add_systems(Update, update_manager_pos)
.init_resource::<ChunkManager>()
.init_resource::<DirtyRects>();

Expand Down
2 changes: 1 addition & 1 deletion src/particles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub struct ParticlesPlugin;
impl Plugin for ParticlesPlugin {
fn build(&self, app: &mut App) {
app.add_systems(
Update,
FixedUpdate,
(
hydrate_particles.before(update_particles),
update_particles.after(chunk_manager_update),
Expand Down
14 changes: 10 additions & 4 deletions src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,15 @@ pub struct SavingTask(pub Option<Task<()>>);
pub struct PlayerPlugin;
impl Plugin for PlayerPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, (update_player.after(chunk_manager_update),))
.add_systems(PostUpdate, (update_player_sprite, tool_system))
.insert_resource(SavingTask::default())
.add_systems(PostStartup, player_setup.after(manager_setup));
app.add_systems(
FixedUpdate,
(
update_player.after(chunk_manager_update),
update_player_sprite,
tool_system.after(chunk_manager_update),
),
)
.insert_resource(SavingTask::default())
.add_systems(PostStartup, player_setup.after(manager_setup));
}
}

0 comments on commit ba5d885

Please sign in to comment.