Accelerometer data game controller

If the problem is that the accelerometer is changing too quickly for smooth controls, maybe average it out.

Is that the problem? If so, the closest match that I have right now is the FPS gauge… Free Template Tuesday #6 – Tumult Hype “FPS” – Photics.com …when I used the exact values, the needle would move too erratically, so I used Hype's JavaScript API to slowly transition the needle.

Part II of the FPS template shows how to use an array to collect the FPS data… Free Template Tuesday #8 – Tumult Hype “FPS” (Part II) – Photics.com …so perhaps that technique could be used (or perhaps modified) to smooth out the change in acceleration.

It could also be a limitation of the technology. An accelerometer uses springs… Accelerometer - Wikipedia …at least I think that's how it works. When the movement stops in one direction, that's going to cause the spring to act differently.

It looks like you're having trouble with “oscillations”. Wikipedia puts the word “Wiggles”in parenthesis. Perhaps the accelerometer mass is not dampened enough for your project needs, or perhaps the device is broken?

Around 2010, when the iPhone was still new technology, I was using the accelerometer for game development. There is some information about using the Accelerometer as a game controller in my GameSalad Textbook… GameSalad Textbook – Photics.com …but I'm not sure if it will help you.

Ultimately, I don't remember using accelerometer data much after making that book. :man_shrugging:t2:

1 Like