AEFeinstein / Super-2024-Swadge-FW

Firmware for the Super Magfest 2024 Swadge
https://adam.feinste.in/Super-2024-Swadge-FW/
MIT License
10 stars 9 forks source link

Tilt Controls for 2048 #256

Open johnnywycliffe opened 1 month ago

johnnywycliffe commented 1 month ago

Summary There are several requests for tilt controls for the 2048 game. They were left out of the initial pull due to an inability to test on my part. Once I get that fixed, I will be implementing this.

Technical Spec Depending on user input, a set of tilt controls can be enabled. Button entry will not be disabled. Player will be able to tilt the swadge to drop blocks, before returning it to level to reset the tilt. Otherwise, it would just constantly dump blocks which wouldn't be very practical. Players will also be able to re-center the IMU as an anti-frustration feature.

On top of the hardware requirements already required for 2048, the IMU will be required.

UI

Controls:

How to Test Play a game of 2048, press "B" to enter the game, and tilt the swadge around to shift the blocks. IMU re-centering can be tested by moving it way out of previous orientation before pressing B, then tilting the swadge once more. All other changes should be self-evident as visual indications.

AEFeinstein commented 1 month ago

From #255

My Windows PC will not allow for proper communication between my swadges and serial terminals. I can flash swadges, but I can't get them to report acceleration data either.

I don't know how you're trying to report that data, but it may be easiest to use the Swadges's USB HID controller mode. It's already reporting orientation data there, so the trick would be getting the emulator to recognize that as input rather than the keyboard. And at that rate, you could pipe all the USB HID events into the emulator and use the Swadge as a full controller for the emulator. image

AEFeinstein commented 1 month ago

https://github.com/signal11/hidapi is intriguing