How kaganxsahin/kagansduckhuntgame works
This is a Unity Duck Hunt game integrated with an Arduino light gun. The player pulls the physical trigger; Arduino sends the fire signal to Unity, which performs a brief black-frame/white-target detection sequence. Arduino reports the light-sensor result, enabling Unity to register a hit, while Arduino drives recoil feedback. The README documents these responsibilities and the script roles; source excerpts were unavailable, so links between individual Unity scripts are limited to documented relationships.
Main entry points: GameController.cs Game Logic · DuckGun.ino Gun Controller · ComController.cs Serial Connection · Duck.cs Duck Target
Components 11
Light Gun Hardware
- Trigger Switch
- Light Sensor
- Gun Controller
DuckGun/DuckGun.ino - Recoil Motor
Serial Integration
- Serial Connection
KagansDuckHuntGame/Assets/Scripts/ComController.cs
Unity Game
- Game Logic
KagansDuckHuntGame/Assets/Scripts/GameController.cs - Game Scene
KagansDuckHuntGame/Assets/Scenes/GameScene.unity - Duck Target
KagansDuckHuntGame/Assets/Scripts/Duck.cs - Score Feedback
KagansDuckHuntGame/Assets/Scripts/ScoreObject.cs
Other components
- Player
- Game Display
Connections 8
- Player → Trigger Switch: pulls
README.md - Gun Controller → Serial Connection: sends serial data
README.md - Serial Connection → Game Logic: delivers signals
README.md - Game Logic → Game Display: renders flash
README.md - Light Sensor → Gun Controller: reports light
README.md - Gun Controller → Recoil Motor: activates recoil
README.md - Game Logic → Duck Target: validates target
- Game Logic → Score Feedback: updates feedback