Skip to content

Commit

Permalink
mobile touches
Browse files Browse the repository at this point in the history
  • Loading branch information
Powerock38 committed Sep 16, 2024
1 parent f4568cc commit 07767e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quatre-Deux-Un
# [Quatre-Deux-Un](https://powerock.itch.io/quatredeuxun)

Throw three dices
Try to make combinations
Expand Down
3 changes: 2 additions & 1 deletion src/dice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub fn roll_dices(
mut commands: Commands,
last_combination: Option<Res<LastCombination>>,
button_input: Res<ButtonInput<MouseButton>>,
touches: Res<Touches>,
mut query: Query<(
&Dice,
&mut Transform,
Expand All @@ -85,7 +86,7 @@ pub fn roll_dices(
) {
let mut rng = thread_rng();

if button_input.just_pressed(MouseButton::Left) {
if button_input.just_pressed(MouseButton::Left) || touches.any_just_pressed() {
commands.remove_resource::<LastCombination>();

for (dice, mut transform, mut angular_velocity, mut linear_velocity) in &mut query {
Expand Down

0 comments on commit 07767e4

Please sign in to comment.