The article will tell about code to optimize the value of efficient to writing mobile phone game. I come to use example be told about for everybody when to use why to plant the code that the method will come to optimize you, make our program as far as possible mining MIDP is in the mobile phone place remnant very few expressional strength. We will see the Profiler function that how uses J2ME Wireless Toolkit will find out the position that optimizes code, I can give out finally the advice that writes J2ME program.
Why to want to optimize?
Game can be differentiated to be two kinds of more extensive types: Real time with key-press drive model. The game of key-press drive type shows the state with current and located game on screen commonly, and await a player input certain key-press to come drive play continues to move. Chess card kind game, major riddle kind game and strategy kind with the character kind game belongs to this kind of game. And real time game, especially the input that behavioral game won't await a player, they run the end till game all the time.
Movement kind game a main feature is many operation Hua Zaibing act shows go up, and refresh rate (FPS) must maintain in 10 above. This kind of game still must want to many movements will make game has taller challenge sex. This kind of game needs a player to quick response and very good hand eye coordinate ability, the reaction that so this kind of game inputs to clavier also has extremely high demand. To make the program is in timely response can be made to clavier when high speed moves, image can move with high-speed FPS, we must optimize our code, with making our program can move with the rapiddest rate.
J2ME is a compact Java version, suit to have the small-sized facility of finite capacity only, for example mobile phone and PDA, j2ME sets stock:
· inputs ability finitely
· screen size is very small
· gets bounds memory and caboodle bulk
The CPU with very slow ·
These characteristics make fast play is being written on J2ME platform is not an easy thing. to computer game, the play that writes J2ME platform to go up can have to the program higher demand and further challenge.
When need not optimize?
If you are written game often behavioral game, need not be optimized likely. If player need ponders over him a few seconds a few minutes even,go next, then he will not notice the key-press of your game answers more than hundreds of millisecond. If your program needs many operation to decide how it goes next,nevertheless an exception is, for example chess kind game needs to be in millions of planting go searching in combination. If such word, computer needs a few seconds only and you want to optimize your code likely is not a few minutes go deciding him in order to make next tendercy.
Although you are writing this kind of play, optimizing also is quite dangerous. These technologies will accompany high price, he will make your code not legible. This is balanced with respect to need him developer. The size that increased JAR file will exchange a program of a few function whether is rising worthiness. More reason that give out to be not optimized below.
Previous12 3 Next
Hot Tags: