-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Update readme with technical details
- Loading branch information
Showing
1 changed file
with
123 additions
and
10 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 |
---|---|---|
@@ -1,27 +1,140 @@ | ||
# fiveTargetGame | ||
|
||
Set of two applications targetting Microchip AVR chips, implementing shooting game. | ||
The game is made of two parts: the *gun* and the *targets*. | ||
There is up to four players, trying to shoot five targets in a row, using 5 tries. | ||
Set of two applications targetting Atmel/Microchip [ATMega328P](https://www.microchip.com/en-us/product/atmega328p), implementing shooting game. | ||
|
||
At some point, games ends and the player with best shot/hit ratio wins the game. | ||
Using a *gun*, users tries to hit *targets*. | ||
The game is up to four players: yellow, green, red and blue. | ||
There are 5 targets. | ||
|
||
## target | ||
The **target** application manages player points and communicate with an Android application implemented on top of [Bluetooth Electronics](https://www.keuwl.com/apps/bluetoothelectronics/) application. It manages the game logic and player points. | ||
### Game mode | ||
|
||
#### Biathlon like | ||
Each player turn gives 5 shots. Player tries to hit each target. Total number of shoots is counted, as well as successfull hits. | ||
|
||
## Gun | ||
## Functional details | ||
### target | ||
|
||
The **target** application manages player points and turns. It communicates with an Android application implemented on top of [Bluetooth Electronics](https://www.keuwl.com/apps/bluetoothelectronics/) application. It manages the game logic and player points. | ||
|
||
|
||
### Gun | ||
The **Gun** application manages the gun. Using two buttons, it allows: | ||
|
||
| Press | Button 1 | Button 2 | | ||
|-------|------------------|--------------------------------| | ||
| short | power on / shoot | Begin new round (give 5 shots) | | ||
| short | shoot | Begin new round (give 5 shots) | | ||
| long | power off | continuous laser (calibration) | | ||
|
||
Gun application manages following outputs: | ||
* Laser | ||
* vibrator | ||
* led | ||
* 128x32 I²C display | ||
|
||
## Architecture details | ||
|
||
Some parts of the projet, implementing logic, can be used on both native and target platform. | ||
All that code is represented in the "domain" package below. | ||
|
||
Both **target** and **Gun** application are run both native and cross environment. The current | ||
target hardware for both is the [ATMega328p](https://www.microchip.com/en-us/product/atmega328p) chip from Atmel/Microchip. | ||
To facilitate testing and extension, user interface (Gui) and hardware abstraction (HAL) are provided using interfaces. Implementation exists for native and cross (i.e. testing) environments. | ||
|
||
|
||
```mermaid | ||
classDiagram | ||
Game "4" *--> User : "Manages" | ||
BTEGui ..|> ITargetGui | ||
TargetApp *--> "1" Game | ||
TargetApp *--> "1" 328TargetsHal | ||
TargetApp *--> "1" BTEGui | ||
TestHal ..|> ITargetHal | ||
TestGui ..|> ITargetGui | ||
ConsoleTargets *--> "1" Game | ||
ConsoleTargets *--> "1" TestGui | ||
ConsoleTargets *--> "1" TestHal | ||
ConsoleGun *--> "1" Gun | ||
ConsoleGun *--> "1" TestHal | ||
GunApp *--> "1" Gun | ||
GunApp *--> "1" 328GunHal | ||
328TargetsHal ..|> ITargetHal | ||
328GunHal ..|> IGunHal | ||
namespace ATMega328{ | ||
class 328TargetsHal{ | ||
} | ||
class 328GunHal{ | ||
} | ||
} | ||
namespace Domain { | ||
class Game{ | ||
} | ||
class User{ | ||
} | ||
class BTEGui{ | ||
Dedicated for communication with \nBlueTooth Electronics Android application | ||
} | ||
class Gun{ | ||
} | ||
class ITargetHal{ | ||
<<interface>> | ||
} | ||
class IGunHal{ | ||
<<interface>> | ||
} | ||
class ITargetGui{ | ||
<<interface>> | ||
} | ||
} | ||
namespace Native { | ||
class ConsoleTargets{ | ||
Runs on native environment for test purpose | ||
} | ||
class ConsoleGun{ | ||
Runs on native environment for test purpose | ||
} | ||
class TestHal{ | ||
} | ||
class TestGui{ | ||
} | ||
} | ||
namespace TargetHost { | ||
class TargetApp{ | ||
Runs on dedicated hardware\nPlatform ATMega328P | ||
} | ||
} | ||
For more details of gun logic, see test cases. | ||
namespace GunHost { | ||
class GunApp{ | ||
Runs on modded Nerf gun\n Platform ATMega328P | ||
} | ||
} | ||
``` |