1. Don't draw the background each cycle. Use a background ImageView instead.
2. Use an ImageView for the moon and call RotateView to rotate it:
https://www.b4x.com/android/forum/threads/animations.46156/#post-338075
After these changes it runs in 60fps.
ok, i understand what you mean erel. so you recommend to use views and not draw everything to the canvas.
when i created Mr. Bucket (2 years ago) i did it the same way. i tried first using canvas but get very bad performance so i switched to views.
but i dont understand why it is like this.
i could use ispritekit for that game but it should be a very simple game so i thought i would do it via canvas. it would be great if we could create
games only via canvas and get good performance. i dont expect 60 fps but at least 40.
anyway thank you for taking time and create those project for us so we can understand better. it is very much appreciated.
i will use the View-technique for my game and leave canvas until someone create something similar to Accelerated surface like we have on android where we
can use simple tools like canvas and still get great performance.
thanx a lot, ilan