Development Program: Crazy Bombs
Development progress: Phase I.
Highlights of the period: Design client game features
Development platform: Java Platform
From the benefit of the 3G industry, must be mobile games, mobile games should be how to develop it? Is it the same as game development on a PC platform? Don't worry, follow us to develop a mobile phone games, you will understand everything. This period we first talk about the client's game function.
Mobile games have a bright future
Domestic mobile phone network game first appeared in 2004, initially by 3 people team development and operation of leisure online games-"mobile player" series. The first company to develop mobile phone games is the "three legends." Mobile games have grown to now have dozens of mobile phone online games online operation. Yi Enfodesk released the "2009 1th Quarter China Mobile games market Quarterly monitoring" data show that the 1th quarter of 2009, Chinese mobile games users up to 3.3 million, the chain growth of 16%.
Tips: Mobile Gaming portal when the 2008-year survey shows that the current mobile games users, students (38.4%), company staff (21.3%), workers (12.8%) and the military (3.7%) accounted for the total of 76.2%, they are the main consumers of mobile games online. In age, 15 to 25 years old users become mobile phone online consumption of the main body, accounting for nearly 90%.
There are three factors that puzzle the development of mobile phone games: network speed, network cost is expensive and experience sex is poor. With the rapid development of 3G, mobile phone network transmission speed will be greatly improved, network costs will also be down in the future. With the guarantee of transmission speed, the game will do a very detailed, more powerful, natural experience will be better. At this year's ChinaJoy exhibition, also set up a special mobile phone online zone, it is clear that the future is very bright (figure 1).
Java ME technology because of the wide range of supported mobile phones, developers, in the entire mobile phone network game development technology occupies a dominant position, with the introduction of MIDP3.0 specification, Java me technology will become the most important development of mobile phone network game technology.
Design idea of client game function
Mobile phone network games and ordinary network programs, in the actual design are divided into client and server side two parts for development. The development client, mainly includes the interface design, the user operation control and the network transmission three parts. The development server side, then mainly includes the network transmission, the data storage and the core logic three parts. So the difference between the network program and the general program is to move the data and logic processing part of the stand-alone program to the server, and then the data exchange through the network transmission and the client, so as to realize the function of the program.
"Crazy Bomb" is a similar "bomb man" of the two-game games. This game contains two interfaces (Figure 1): Wait for the interface and game interface, waiting for a simple interface, the interface is a flashing text. The game interface is the main interface of the program. Because the interface contains a lot of elements, so the idea of layering the interface: first draw the background block with background layer, and then draw the barrier layer, and finally draw characters and bombs.
And for the user's operation control, the client first to do some basic judgments, and then convert the user operation to a certain format sent to the server side, by the server to determine whether it can operate, the client program based on server-side processing results to determine whether the operation is successful.
State machine Mechanism explanation
Because of the need to implement two interfaces in the program: Wait interface and game interface, in order to simplify the logical processing, the two interfaces are written inside a code, which requires the use of a common control mechanism in interface development-state machine mechanism.
The principle of the state machine mechanism is: using an int state variable to control which interface is displayed, for example, the value of the variable is 0 o'clock to display the wait interface, the value of the variable is 1 o'clock Display game interface, so you can control the state variable to achieve the interface display and switch.
Using a state machine mechanism makes it easy to make multiple sets of interfaces within a single code, making the structure of the code very clear. In addition, it is also necessary to consider layering the complex interfaces. Layered processing refers to the logical processing of the same elements divided into one layer, similar to the concept of the middle of Photoshop, such as the decorative background block to form a background layer, will participate in the collision process of the part of the collision layer and so on, and the characters need to deal with a separate layer.
This approach not only makes the interface to draw a clear structure, more importantly, to simplify the logic processing, so as to develop more complex interface programs. State machine mechanism, in the complex procedures used more, especially mobile phone game program, there are interested in this direction friends must master it.
The implementation code in this program is:
/** 界面控制状态值 */
int status;
/** 等待界面 */
final int WAITING_SCREEN = 0;
/** 游戏界面 */
final int GAME_SCREEN = 1;
In each method of the code, according to the value of the variable status of the different logical processing, so as to achieve state machine mechanism.