Skip to content

Commit

Permalink
add rollbacks to fuses and destructible walls
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksa2808 committed Nov 12, 2023
1 parent ae88ae7 commit d72c51a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,17 @@ pub fn bomb_drop(
},
});

parent.spawn((Text2dBundle {
text,
transform: Transform::from_xyz(0.0, TILE_HEIGHT as f32 / 8.0 * 2.0, 0.0),
..Default::default()
},));
parent
.spawn((Text2dBundle {
text,
transform: Transform::from_xyz(
0.0,
TILE_HEIGHT as f32 / 8.0 * 2.0,
0.0,
),
..Default::default()
},))
.add_rollback();
});
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use bevy::{
ui::{PositionType, Style, Val},
utils::HashSet,
};
use bevy_ggrs::AddRollbackCommandExtension;
use itertools::Itertools;
use rand::{rngs::StdRng, seq::IteratorRandom, SeedableRng};

Expand Down Expand Up @@ -252,6 +253,7 @@ pub fn spawn_map(
Destructible,
*position,
))
.add_rollback()
.id();
wall_entity_reveal_groups.push(vec![entity]);
}
Expand Down

0 comments on commit d72c51a

Please sign in to comment.