Add vibro on move. Song on game end.

This commit is contained in:
Derek Jamison 2023-03-04 16:17:45 -05:00
parent b8db448de7
commit 72b1d89078
2 changed files with 555 additions and 413 deletions

View File

@ -1,14 +1,20 @@
# Rock Papper Scissors # Rock Papper Scissors
## Introduction ## Introduction
This is game of Rock, Paper, Scissors. In version 1, we use the subghz radio to find other players, communicate moves, and exchange contact information.
This is game of Rock, Paper, Scissors. In version 1, we use the subghz radio to find other players, communicate moves, and exchange contact information.
## Status ## Status
This is currently a work in progress... This is currently a work in progress...
- Most of the game logic is complete (two flippers should be able to play against each other.) - Most of the game logic is complete (two flippers should be able to play against each other.)
- UI to show Flipper images instead of just debug text. - UI to show Flipper images instead of just debug text.
- Vibro on button press (valid move).
- "Song" when win/loss/draw.
Remaining work (for subghz version): Remaining work (for subghz version):
- Tone when button pressed.
- Show games found & let user pick the game to join. - Show games found & let user pick the game to join.
- Log joined game into SD card. - Log joined game into SD card.
- Log game results into SD card. - Log game results into SD card.
@ -21,21 +27,26 @@ Remaining work (for subghz version):
- Add game ending animations. - Add game ending animations.
Future ideas: Future ideas:
- Uses Princeton signals for second player. - Uses Princeton signals for second player.
- Create stand-alone hardware badges that can play the game too. - Create stand-alone hardware badges that can play the game too.
- Instead of subghz, use IR. - Instead of subghz, use IR.
- Instead of subghz, use GPIO. - Instead of subghz, use GPIO.
## Installation Directions ## Installation Directions
This project is intended to be overlayed on top of an existing firmware repo. This project is intended to be overlayed on top of an existing firmware repo.
- Clone, Build & Deploy an existing flipper zero firmware repo. See this [tutorial](/firmware/updating/README.md) for updating firmware.
- Clone, Build & Deploy an existing flipper zero firmware repo. See this [tutorial](/firmware/updating/README.md) for updating firmware.
- Copy the "rock_paper_scissors" [folder](..) to the \applications\plugins\rock_paper_scissors folder in your firmware. - Copy the "rock_paper_scissors" [folder](..) to the \applications\plugins\rock_paper_scissors folder in your firmware.
- Build & deploy the firmware. See this [tutorial](/firmware/updating/README.md) for updating firmware. - Build & deploy the firmware. See this [tutorial](/firmware/updating/README.md) for updating firmware.
- NOTE: You can also extract the rock_paper_scissors.FAP from resources.tar file and use qFlipper to copy the file to the SD Card/apps/Misc folder. - NOTE: You can also extract the rock_paper_scissors.FAP from resources.tar file and use qFlipper to copy the file to the SD Card/apps/Misc folder.
### Open question - Should we use "applications" or "applications_user"? ### Open question - Should we use "applications" or "applications_user"?
## Running the updated firmware ## Running the updated firmware
These directions assume you are starting at the flipper desktop. If not, please press the back button until you are at the desktop.
These directions assume you are starting at the flipper desktop. If not, please press the back button until you are at the desktop.
- Press the OK button on the flipper to pull up the main menu. - Press the OK button on the flipper to pull up the main menu.
- Choose "Applications" from the menu. - Choose "Applications" from the menu.
@ -47,9 +58,10 @@ These directions assume you are starting at the flipper desktop. If not, please
- On one of the flippers press Left arrow to join the game. - On one of the flippers press Left arrow to join the game.
- Once two players are joined: - Once two players are joined:
- Press "OK" to send "1". The other player should also press "OK" to send "1" back (at the same time!)
- Press "OK" to send "2". The other player should also press "OK" to send "2" back (at the same time!) - Press "OK" to send "1". The other player should also press "OK" to send "1" back (at the same time!)
- Press "UP" to send a "Rock", or "RIGHT" to send a "Paper", or "DOWN" to send a "Scissors". The other player should send at same time! - Press "OK" to send "2". The other player should also press "OK" to send "2" back (at the same time!)
- Press "UP" to send a "Rock", or "RIGHT" to send a "Paper", or "DOWN" to send a "Scissors". The other player should send at same time!
- Rules: - Rules:
- Rock beats Scissors. - Rock beats Scissors.
- Paper beats Rock. - Paper beats Rock.
@ -58,28 +70,30 @@ These directions assume you are starting at the flipper desktop. If not, please
- Press the BACK button to exit. - Press the BACK button to exit.
## HackRF One ## HackRF One
- If you do not have two Flipper Zero devices, you can use a HackRF One to record messages & broadcast those messages at a future date. I made a [YouTube](https://www.youtube.com/watch?v=S0sgcDQrVOc) video demo of how to record and broadcast messages.
- If you do not have two Flipper Zero devices, you can use a HackRF One to record messages & broadcast those messages at a future date. I made a [YouTube](https://www.youtube.com/watch?v=S0sgcDQrVOc) video demo of how to record and broadcast messages.
- To record a message: (replace "flipper-chat.rf" with the file name you want to use, such as "select-rock.rf".) - To record a message: (replace "flipper-chat.rf" with the file name you want to use, such as "select-rock.rf".)
``` ```
sudo hackrf_transfer -r flipper-chat.rf -f 433920000 -s 8000000 sudo hackrf_transfer -r flipper-chat.rf -f 433920000 -s 8000000
``` ```
- To broadcast a message: (replace "flipper-chat.rf" with the saved file name.) - To broadcast a message: (replace "flipper-chat.rf" with the saved file name.)
``` ```
sudo hackrf_transfer -r flipper-chat.rf -f 433920000 -s 8000000 -x 47 sudo hackrf_transfer -r flipper-chat.rf -f 433920000 -s 8000000 -x 47
``` ```
- What I typically do is: - What I typically do is:
- Use the Flipper Zero to send a messasge that I record, then I play back that message at a later time when I want to pretend the other Flipper Zero is sending a message. You can use the chat app in https://lab.flipper.net/cli, like shown in the video to send a specific packet (or you can use your own code to create the packet.) - Use the Flipper Zero to send a messasge that I record, then I play back that message at a later time when I want to pretend the other Flipper Zero is sending a message. You can use the chat app in https://lab.flipper.net/cli, like shown in the video to send a specific packet (or you can use your own code to create the packet.)
- Use the HackRF One to record the message from my Fliiper Zero. Then later I use the chat app in https://lab.flipper.net/cli, to see what the message was (or I replay the message to see how my application would respond.) - Use the HackRF One to record the message from my Fliiper Zero. Then later I use the chat app in https://lab.flipper.net/cli, to see what the message was (or I replay the message to see how my application would respond.)
## Details about the project files ## Details about the project files
- application.fam - application.fam
- specifies the name of our application. - specifies the name of our application.
- specifies the entry point for our application. - specifies the entry point for our application.
- specifies we use the GUI. - specifies we use the GUI.
@ -87,6 +101,7 @@ sudo hackrf_transfer -r flipper-chat.rf -f 433920000 -s 8000000 -x 47
- specifies our application can be found in the "Misc" category. - specifies our application can be found in the "Misc" category.
- rock_paper_scissors.png - rock_paper_scissors.png
- The icon for our application that shows up in the "Misc" folder. - The icon for our application that shows up in the "Misc" folder.
- rock_paper_scissors.c - rock_paper_scissors.c

File diff suppressed because it is too large Load Diff