I am writing this post as part of a course called Mobiilituotekehitys (Mobile development) held by Tero Karvinen
I am using Eclipse to develop PhoneGap applications on a 64-bit Xubuntu 12.10 installed on a HP EliteBook 2560p Laptop.
The ball rolls to either left or right according to where you tilt the phone.
Doesn’t work / alpha / beta / release
Tested on Samsung Galaxy Gio S5660 & Sony Ericsson Xperia Active
The program checks if the phone is tilted a certain amount either clockwice or counter-clockwise and changes the balls position accordingly by looping the ball’s x’-location and adding or reducing 5. Depending which way the phone is tilted.
I used Accelerometer API and processing-1.4.1.min.js -library to do this assignment.