forked from flipperdevices/flipperzero-firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ashley Huxley
committed
Jul 7, 2024
1 parent
9b4e6cb
commit 0ec2875
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Protocol Specification | ||
|
||
The game communicates actions to the other flipper using an array of three bytes. The first byte indicates the player and the action that the player performed. The second two bytes contain the X and Y coordinates of the location of that action. | ||
|
||
## First Byte | ||
|
||
| Bit | Description | | ||
| ----| ----------- | | ||
| 0 | Unused | | ||
| 1 | Unused | | ||
| 2 | Unused | | ||
| 3 | Player | | ||
| 4-7 | Action | | ||
|
||
The 3rd bit denotes the player: | ||
|
||
0. Fox | ||
1. Wolf | ||
|
||
Bits 4-7 denote the action: | ||
|
||
| Value | Action | | ||
| -------| ------------------------------------------------------------------- | | ||
| 0b0000 | (Reserved) | | ||
| 0b0001 | The player moved to the location specified in bytes 2 and 3 | | ||
| 0b0010 | The player dropped a bomb at the location specified in bytes 2 and 3| | ||
| 0b0011 | The player died. (Location bytes unused and should be set to 0x00) | | ||
|
||
### Example: | ||
|
||
**0x11 0x02 0x03** | ||
The wolf has moved to position (2, 3) | ||
|
||
**0x02 0x05 0x01** | ||
The fox has placed a bomb in position (5, 1) | ||
|
||
**0x13 0x00 0x00** | ||
The wolf has died | ||
|