Skip to content

Classic 2D space shooter game with a simple game loop, player and enemy mechanics, and handling of user input from a custom ESP32-based joystick controller via a TCP connection.

License

Notifications You must be signed in to change notification settings

taherfattahi/esp32-joystick-space-shooter

Repository files navigation

ESP32-joystick-space-shooter

Classic 2D space shooter game developed using WPF. This project demonstrates the implementation of a simple game loop, player and enemy mechanics, and handling of user input from both a keyboard and a custom ESP32-based joystick controller via a TCP connection.

Gameplay Video

Dino Game Screenshot

Controls

The game can be played using either a keyboard or an ESP32 joystick connected via TCP.

Keyboard:

  • Arrow Keys: Move the player's spaceship.
  • Spacebar: Shoot bullets.

ESP32 Joystick (via TCP):

  • Joystick Movement: Controls the spaceship's movement.
  • Switch/Button: Fire bullets.

The application listens on port 13000 for a TCP connection from the ESP32 controller. The status of the ESP32 connection is displayed on the screen.

Technical Details

  • Framework: The project is built using WPF (Windows Presentation Foundation) and .NET 8.
  • Language: The entire application is written in C#.
  • ESP32 Firmware: The source code for the joystick controller is contained in the esp32-joystick.ino file.
  • Networking: A TCP listener is implemented to receive input from the ESP32 controller over Wi-Fi. The application uses asynchronous network programming to handle the connection without freezing the game.
  • Game Logic: The game loop is managed by a DispatcherTimer. All game elements, including the player, enemies, and bullets, are represented as Rectangle objects on a Canvas.

Contributing

Contributions are welcome. If you find a bug or have a feature request, please open an issue or submit a pull request.

About

Classic 2D space shooter game with a simple game loop, player and enemy mechanics, and handling of user input from a custom ESP32-based joystick controller via a TCP connection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published