gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Motion Sensor > Tips on interpreting the motion values

#148721 - melw - Wed Jan 09, 2008 10:35 am

Hi,

I've had a DS Motion card for a while but haven't done anything with it until recently. So, I made this small game, but I'm not quite happy how the motion controlling is being used currently. Any tips on making better motion controlled ball movement are appreciated.

Here's roughly what I'm doing each frame right now:

Code:
motx = motion_acceleration_x();
moty = motion_acceleration_y();
storeMotionAccelerationValues();
interpolateBothXandYfromLastNframes(); // currently using 4 frames to "smoothen" the movement
ballSpeedX += motx;
ballSpeedY += moty;
checkTheSpeedLimits();

For the reference, you can start the game without a Motion Card / Pak and test the movement with d-pad. Oh, and press A to calibrate the Motion Card.

#148745 - KeithE - Wed Jan 09, 2008 6:53 pm

I think it feels pretty good, but I would prefer it to be a little more sensitive (multiply motx and moty by a number larger than 1).

Also, I think it would feel better if the background did not move as you tilt the DS.