In response to the call of www.j2medev.com webmaster mingjava, I would like to share my experience with you. At the same time, www.j2medev.com welcomes original articles from experts.
A few days ago, he saw tony publish his learning work on csdn "60 s for a man". He thought that although his creativity was simple, he was very playable. He was an entry-level classic in learning how to create mobile games, as a result, tony's image is still used for learning. If you are interested in this game, contact tony or visit his blog.
In terms of development trends, midp2.0 is a trend. The cheapest midp2.0 mobile phone, such as ot735i, is already about 1700 yuan. The Siemens high-end machine cx65 a year ago is only about 2500 yuan; in addition, the price of-midp2.0 mobile phone has a variety of options, Siemens, se, N machines are available. I personally like cx65. If the costs of mobile phone manufacturers keep decreasing in the future, I believe that 1500 yuan of midp will not be a dream... Of course, it depends on whether the application is rich.
To put it bluntly, we will use midp 2.0 to develop our game code: fly. Development Tool jbulider. After the article is fully written, the src download will be provided.
Directory:
I. Game framework
2. Improve peripheral tools (images, GameObject, and Font)
Iii. control plane movement
4. Add a bullet group for collision calculation
5. Implement the explosive effect and add a prop Missile
6. What do you think?
VII. Source Code
I. Game framework
Our games require a general game framework for future development, but implementing an engine is complicated. As a beginner, if you want to think too much about it, I am afraid it will lead you away from the main line. Here we only provide the canvas code, if you do not understand it, you can refer to another series of articles on this site, "using MIDP2.0 to develop Games".
Use singlon, because each gamecanvas requires a lot of memory space. In addition, we only need to rewrite gameInit (), gameMain (), and write the code initialized at one time in the constructor.
Public class MyGameCanvas extends GameCanvas
Implements Runnable, CommandListener {
Private static MyGameCanvas instance;
Graphics g;
Boolean running;
Thread t;
Command startcmd, exitcmd, restartcmd;
Int keystate;
Boolean keyevent;
Boolean key_up, key_down, key_left, key_right, key_fire;
Private boolean allowinput;
Public int screenwidth;
Public int screenheight;
Boolean gameover;
// Define your variable here
// Define your variable end
Protected MyGameCanvas (){
Super (true );