Skip to content

A simple Pong game but the player paddle is controlled with esense earables. The user leans to the left and right and the paddle will follow.

License

Notifications You must be signed in to change notification settings

wagpa/pongsense

Repository files navigation

Pongsense

Pongsense is a simple implementation of the game Pong with flutter (for android). But with a twist, the player paddle is controlled with the ESense Earable.

As the player tilts his head to the left and right, the paddle follows. This gives an interactive and dynamic way to play an old classic.

Considerations

  • Target domain: Anyone who wants to replay an old classic while also getting some movement in
  • Application class: Gamebox
  • Senses used: Motory skills and vision (coordination between head position and eyes)
  • Addressed part of memory: Long-term procedural memory (sensory memory)

Usage

To play the game with the best experience, follow these steps.

  1. Open the app and enable Bluetooth and GPS
  2. Start your ESense Earable
  3. While on the Connect-Tab, click on Connect
  4. Wait until all connection state items have a checkmark
  5. Go on the Calibrate-Tab
  6. Tilt your head to the far left an click Calibrate Left
  7. Tilt your head to the far right an click Calibrate Right
  8. Now all calibrate state items should have a checkmark
  9. Go on the Play-Tab
  10. You can now move the (blue) player paddle by tilting your head from left to right
  11. Try to get a high score before loosing all your lives (displayed on the top left, over the current score)
  12. Have fun 😄

⚠️ Disclaimer: This app is only tested on android, as we don't own an iOS device. It is expected to be used on mobile.

Features

Every feature of the app has a person responsible for it. This person created most or all of it.

Feature Paul Rico
:octocat: Custom flutter ESense fork ✔️ ✔️
🔀 Tab routing with bottom navigation bar ✔️
🔌 Connect tab ✔️
📐 Calibrate tab ✔️
↩️ Communicate global state to widgets with event-callbacks ✔️
👀 3D representation of eareble accelerometer ✔️
👾 Ingame components (player/ai/ball/blockers) ✔️
🎲 Responsive ingame blocker grid generation ✔️
🚀 Improved collision detection for fast moving ingame components ✔️
↙️ Smart collision handling for ingame components ✔️
🎵 Ingame soundeffects and music integration ✔️
🏆 Ingame pause and endgame overlay ✔️
♻️ Ingame game reset handling ✔️
📡 BLE connection state handling ✔️
👷 Failsafe eareable initialization sequence ✔️
💥 Unexpected disconnect handling ✔️
📏 Calibration handling ✔️
📋 Eareable config sensitive calculations (needs custom fork) ✔️
🎯 Eareable orientation calculation ✔️
📯 Eareable event propagation for Flame components ✔️

Custom Flutter Esense Fork

We created a custom fork for the flutter_esense package. To be able to convert the ESense outputs in usable formats like g or m/s^2, you have to get the current device configuration. Specifically to convert the accelerometer output, you need the accelerometers sensitivity factor. The problem is, that the original flutter package didn't map the ESense output to the provided event class (see here). Additionally we added utilities to convert the config values into the sensitivity factors specified in the ESense specification (see here).

Screenshots

Pongsense connect screen

Pongsense calibrate screen

Pongsense play screen

Authors

The project was created by Rico Münch (uozjn) and Paul Wagner (ujhtl).

Sources

The Audio Files that are used in the project are imported from Storybooks.

The following Libraries are used in the project

See the dependencies in the pubspec.yml for more information.