diff --git a/src/game.rs b/src/game.rs index ca8391d..9ec0f96 100644 --- a/src/game.rs +++ b/src/game.rs @@ -31,7 +31,8 @@ impl Game { GameState::Playing => { let jump = rl.is_key_pressed(KeyboardKey::KEY_SPACE) || rl.is_key_pressed(KeyboardKey::KEY_UP) - || rl.is_key_pressed(KeyboardKey::KEY_W); + || rl.is_key_pressed(KeyboardKey::KEY_W) + || rl.is_mouse_button_pressed(MouseButton::MOUSE_BUTTON_LEFT); self.world.update(dt, jump, &self.cfg); @@ -47,6 +48,7 @@ impl Game { if rl.is_key_pressed(KeyboardKey::KEY_R) || rl.is_key_pressed(KeyboardKey::KEY_SPACE) || rl.is_key_pressed(KeyboardKey::KEY_ENTER) + || rl.is_mouse_button_pressed(MouseButton::MOUSE_BUTTON_LEFT) { self.world = World::new(&self.cfg); self.state = GameState::Playing; @@ -131,7 +133,7 @@ impl Game { ); // Restart prompt - let prompt = "SPACE / R / ENTER to restart"; + let prompt = "SPACE / R / ENTER / TAP to restart"; let ps = 22; let pw = d.measure_text(prompt, ps); // Blink at ~2 Hz using the world's accumulated elapsed time. @@ -139,7 +141,7 @@ impl Game { d.draw_text(prompt, (sw - pw) / 2, panel_y + 240, ps, Color::new(160, 200, 255, 255)); } - let ctrl = "SPACE / W / UP to jump"; + let ctrl = "SPACE / W / UP / TAP to jump"; let cw = d.measure_text(ctrl, 18); d.draw_text(ctrl, (sw - cw) / 2, panel_y + 285, 18, Color::new(100, 130, 180, 255)); } diff --git a/web/index.html b/web/index.html index 0c84df9..673a89f 100644 --- a/web/index.html +++ b/web/index.html @@ -2,26 +2,37 @@ - + Endless Runner