Lukas Stenner

unread,
Jan 21, 2015, 3:42:31 PM1/21/15
to mitappinv...@googlegroups.com
Hey there,

I started getting into the Appinventor today and did some tutorials. I also animated a ball by myself using a clock. Unfortunetaly, the ball animation is not really smooth compared to other games I can play on my Oneplus One. It seems like the app just has ~20-30 FPS. (The clock is updating every 16ms to come close to 60FPS).

Is there any way to make the animations smoother?
My dad told me a bit abiut fields, maybe that can help?

Thanks!

Taifun

unread,
Jan 21, 2015, 3:56:02 PM1/21/15
to mitappinv...@googlegroups.com
instead of using the clock, for balls you normally define a direction (heading) and a speed 

Heading

Returns the sprite's heading in degrees above the positive x-axis. Zero degrees is toward the right of the screen; 90 degrees is toward the top of the screen.

Speed

The speed at which the sprite moves. The sprite moves this many pixels every interval.

Interval

The interval in milliseconds at which the sprite's position is updated. For example, if the interval is 50 and the speed is 10, then the sprite will move 10 pixels every 50 milliseconds.

btw. 16ms is a very short time, try 50ms instead

also: the more logic you put into your app, the more time will your logic need to do something
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Lukas Stenner

unread,
Jan 21, 2015, 4:04:24 PM1/21/15
to mitappinv...@googlegroups.com
Hey,

I already tried it, but I couldn't see any difference. But thanks anyway
Reply all
Reply to author
Forward
0 new messages