Skip to content

Commit

Permalink
Use Backspace key for restarting the game
Browse files Browse the repository at this point in the history
With this change we switch to using the Backspace key (as opposed to
Return) for restarting the game. They key is generally less frequently
used and less likely to be accidentally pressed as a consequence.
  • Loading branch information
d-e-s-o committed Oct 15, 2023
1 parent b5af05a commit be2ab9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Unreleased
----------
- Handle stone rotation and horizontal stone movements while pausing to
clear complete lines
- Switched to using Backspace key for restarting the game


0.1.0
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ Usage

**tetromino** uses the following key bindings:

| Key(s) | Function |
|--------|------------------------------------------|
| 1 | Rotate stone left |
| 2 | Rotate stone right |
| h | Move stone left |
| l | Move stone right |
| j | Move stone down |
| Space | Drop the stone immediately |
| q | Quit the game |
| Return | Restart the game |
| F3 | Pause (and resume) the game |
| Key(s) | Function |
|-----------|------------------------------------------|
| 1 | Rotate stone left |
| 2 | Rotate stone right |
| h | Move stone left |
| l | Move stone right |
| j | Move stone down |
| Space | Drop the stone immediately |
| q | Quit the game |
| Backspace | Restart the game |
| F3 | Pause (and resume) the game |


Certain aspects of the game can be configured via its configuration
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub fn run() -> Result<()> {
Key::KeyJ => game.on_move_down(),
Key::KeyL => game.on_move_right(),
Key::KeyQ => Change::Quit,
Key::Enter => {
Key::Backspace => {
*repeat = KeyRepeat::Disabled;
game.restart()
},
Expand Down

0 comments on commit be2ab9f

Please sign in to comment.