-
Using the engine provided by the demo revamp added a virtual joystick to achieve the effect of control movement
-
The demo path I used is: examples\deprecated_to_upgrade\isometric_game
-
So what I’m going to do is I’m going to create an imageControl and I’m going to put a button under it and I’m going to handle three events on that button to figure out where the character is going
-
The three events are: OnPress,OnRelease,OnMotion
-
I had almost no performance loss on windows and android, it was very smooth, but it was almost impossible to play properly on ios
-
When I entered the game on ios platform and the screen was still and I did nothing, I only had 5-6 FPS. At first, I thought there was something wrong with my logic, so I started to debug
-
After repeated verification, I got the following results:
-
I had 60 FPS when I didn’t render the map and characters at all and left my virtual joystick scene in a black screen where only the joystick was visible
-
But I kept the logic of the code that calculates the direction of the joystick when I touch it to move it. As long as I keep moving the joystick, the logic will keep triggering, and the fps will drop from 60fps to 50-35 FPS
-
The code of my calculation direction does not have any loops, only some simple arithmetic operations, and the code is less than 20 lines, which is obviously not enough to make the frame drop so badly in my understanding
-
It is worth noting that the same situation I had on windows and android with almost no framerate loss.
-
And I opened up the rendering code for the map scene and I didn’t use the joystick and it only had a frame rate of 5 or 6 FPS so obviously that’s a big performance result
** I want to know what the problem is and I need your help. If you need my code, please provide an email address and I will send it to you so that you can study and debug**.