This isn't a question about general phone performance. I'm aware that they're not as powerful as PC's by a long way and this is just testing on local LAN. But it seems a bit strange, so wondering if it's something I'm doing wrong or is to be expected.
Very basic so far, just working on a simple vertical shooter. Runs at 60fps with about 50 sprites, slows down slightly after that but I expect that so I intend to keep the sprites to 50 or so max.
But what does seem strange is, when I move my player ship with touch control, that slows down the FPS to about 45-50. Now the calculation for moving the ship is slightly complicated, but it's still only one calculation. I know phones are slow, but should a single 'complicated' piece of math make a performance hit like this?
The code for the movement is ...
Touch > Is in touch
Distance (Player.X,Player.Y,Touch.X,Touch.Y) > 750 x dt
Move(Min(750*dt(Distance(Self.X,Self.Y,Touch.X,Touch.Y) pixels at Angle(Self.X,Self.Y,Touch.X,Touch.Y)
Ok, that's a bit complex and it happens every frame, but should it really cause a 10 fps performance hit? I can speed it up of course, but just wondering if I'm missing something here.
I should point out that it's not something else causing this. For example if I turn off all bullets and aliens and everything else, the movement alone still causes a large FPS drop. Is it just the code doing that?