forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   MidletPascal (http://forum.boolean.name/forumdisplay.php?f=46)
-   -   Vibra, Data, Midi (http://forum.boolean.name/showthread.php?t=13845)

NastyKhan 09.12.2010 01:44

Ответ: Vibra, Data, Midi
 
I decided to not implement highscore table.

I've met another problem though. The game runs fine at simulator, but a little too slow on cellphone. Actually it's just.. boring-slow. I tried some things:

1. Disable some heavy functions, like sounds.
2. Disable.. all other functions including controls, most graphical elements etc.
3. Set main loop delay to 1.
4. Hell.. Remove completely main delay. :4to:

No changes. I mean literally - no changes. The game is still perfectly smooth (no jamming) but DAMN slow.

It's almost finished.. i can't end like this. Both phones i'm using supports 2d, and even 3d games with no problems (one also include gyroscope-ball-roller). Why they got so slow with my simple (830 source code lines) game?

Please help.


Edit:
Hmm.. i think i fixed that on as well. It looks like cell phones have FPS capped at 50 frames per second. And 50 frames per second = 1 frame for 20miliseconds. In other words: New 'repaint' cannot be done earlier than 20 miliseconds after previous one. Even if i ask them so, the program will wait 20 ms.

So if I want to make my object move 1 pixel for every cycle, and set cycle delay to 10 milisecond - the object will move 1 pixel/20 miliseconds anyway. To solve this problem i have to make my object move 2 pixel per cycle, and change delay to 20.

Success. :)

odd 09.12.2010 16:14

Ответ: Vibra, Data, Midi
 
Try to use the RepaintPart function. It operates much faster.


Часовой пояс GMT +4, время: 07:44.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot