Accelerometr WORKING EXAMPLE

0 favourites
  • 13 posts
From the Asset Store
Unlock platyers earning coins, and save it with Localstorage
  • Hey guys, i really can not use data which is in manual and i do not really know how to use device tilt/accelerometr function.

    What i need i want some action/expression to lock appmobi on horisontal position, make x axis acceleration and test it on apmobi, if anyone could provide links to real examples or explain funtion by function i would really appreciate it.!!

    sorry for my noobness, i just do not have much time to complete my game

  • Are you using directCanvas? It doesn't support accelerometer yet, but we have a workaround implemented in the next build which should fix it.

  • hmmmm, understood, thanks for the reply Ahley, so anything supports accelerometr atm???

  • I'm writing a complex game based on accelerometer input, here are my personal tests.

    Phonegap supports it on both iOS and Android. I suggest you the 1.7.x releases. Later versions introduced some bugs on android 2.3.x devices.

    Appmobi software supports it but uses a different scale of values for accelerometer data (my suggestion is to write a simple app with three text objects filled with alpha, beta and gamma values to see how accelerometer data are treated in these wrappers).

    Appmobi directcanvas doesn't still support it, neither CocoonJS.

  • Thank You for detailed answer))) Now i am trying to export my test app on phonegap... I build apk but i just do not know how to test it virtually. I installed eclipse and android sdk aswell but emulator is too slow and when i RUN my app just a screen pop up, i guess ill spend a lot of hours reading and learning) I hope next appmobi exporter will be better.

    PS. appmobi requires full screen resolutions which totally destroy my in app positioning, since i'm not boud to pixels but window height and width my ingame ui, sprites just don't fit or too small on screen, which really sucks, my app is build for iphone screen nd iphone emulator just breaks out all my layouts.

  • Yeah, DON'T USE ANDROID SDK EMULATOR, it's so slow that breaks even the C2 engine collision detection.

    I suggest you to use a separte GUI layer with parallax (0,0) and then place GUI elements with perfect pixel positioning based on the resolution you gave to the application (a 16:9 resolution is preferred with this approach).

    Then, with a wise use of anchor behaviors on gui elements your app will be ready to support every mobile resolution out there.

  • Oh, thank you, for all this help,Knifegrinder. i didnt know Droid SDK was that bad, at work my coworkers use Android SDK on macs but they only build apps not games)

    My problem is not that simple, i use 0,0 paralax for that gui but my app doesn't start well, and i can block screen to lanscape ONLY in phone gap exporter but have no way to try it on my ipad since i am not apple developer(((

    I woul really appreciate if you could tell me aswell if i can preview my game and test Device orientation on my home lan or work server: If would post it like html on web on my Lan and then open on my ipad in browser, will i be able to test accelerometr???

  • ACCELEROMETR IN DIRECT CANVAS STILL DOEN'T WORKS EVEN IN R104.... 2 HOUR OF TESTING WITH TEXT AND SQUERES FOR NOTHING-.-

  • Here is my test made like 15 mintes ago, maybe i do something wrong

    dropbox.com/s/t9fei0jcxb89gbe/elrei%20test.capx

  • ElRei - oops, you're right, it still doesn't work in r104. I think I've fixed it for r105 now. Next time it would help to post a bug report so we can deal with the issue quicker.

  • Cool, w8ing for r105 release)))) i wasn't sure it's bug, sometimes humans are bugged and that's why i posted capx file)))

    Thanks Anyway for response, Btw accelerometer works perfectly in LAN preview, but my game runs fast only in appmobi emulator

  • If you have an iPad and you use Appmobi XDK try to export your game with "software render" flag instead of directcanvas. Then with the AppLab installed use the "test anywhere" option. You'll have accelerometer support, a decent speed (don't expect an outstanding framerate, but it's still a lot better than LAN preview) and the ability to lock your game in landscape mode.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • REally appreciate YOur help guys, it helped a lot and i got like 5fps on Appmobi when on Lan preview i got like 0,5-0,6 fps :D

    Will continue work on it, a lot of things to bound. I figured during testing that if you use Layoutwidth object positions correctly, when i used windowwidth my iphone 4 emulator placed onject almost outside of LO which is strange since my Lo is 960,640

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)