Android Practice Project: Push Box
The Push Box is an ancient game from Japan designed to train people's logical thinking skills. The game scene is usually set in a small space in the warehouse, the need to put the box to the designated location. This requires the player to skillfully use the limited space and channels, reasonable arrangement of the box location and moving order to complete the task. With the development of computer games, many programming enthusiasts have developed various versions and various types of push boxes based on the idea of the game. This also includes a lot of mobile phone version of the implementation, along with the popularity of mobile phones and computers, quickly pushed box games into thousands of households.
First, demand analysis :
2.1 Functional Requirements
Before the game development, first needs to the game should have the function analysis, the function analysis is the game development premise, has the demand only then may the game development, and needs analysis must be very detailed, lest causes the unnecessary loss. The specific functions are as follows:
Welcome to the animation interface, the game run after the first entry into the interface.
Menu selection, also need to design a menu interface, and in the menu interface at least four kinds of menus for the user to choose.
The sound effects of the game, the process of the game need to add the sound in the appropriate location, and the sound can be turned on and off settings.
Game help, but also need to add a help screen for the game, a brief introduction of the game's basic functions and gameplay.
Keyboard control, mainly to complete the player's interaction with the game.
Game of victory, the game needs to design the appropriate difficulty, so that the player can work hard to complete the game.
2.2 Performance requirements
Using the rendering technology, push box games are generally used 2D rendering technology, this case in order to enhance the attractiveness of the game, the adoption of 2.5D rendering technology. 2.5D presentation Technology also has a wide range of perspectives to choose from, with a 45-degree view of the game.
2.3 Other requirements
The game plot, this game for the lightweight puzzle game, so there is no very complicated plot. The main work to do in this area is the design of the game, the shape of the warehouse, size, the area can be passed, as well as the initial location and destination of the boxes.
Target audience, the game is more widely, it should be suitable for all ages. In view of the broad audience, the operation should be designed to be more humane, the picture is more fresh.
The target platform for running the game is Android2.1.
Operation mode, the game is intended to use the mobile phone keyboard to operate, for no keyboard model can also consider the use of virtual keyboard.
second, the system design :
System Module division and Operation Flow:
Common categories:
Implementation class pushboxactivity of activity
Keyboard Listener Thread Keythread
Welcome interface Related classes:
Welcome to the interface class Welcomeview
Welcome interface Drawing Thread Class Welcomeviewthread
Welcome to the animation implementation of the interface class Welcomeviewgotread
Menu interface Related classes:
Menu Interface Class Menuview
The drawing thread class of the menu interface Menuviewdrawthread
Animation implementation of Menu interface class Menuviewgothread
Game Interface Related classes:
Game main interface Class Gameview
The drawing thread class of the main game interface Gameviewdrawtread
Map Information Class Maplist
Role Encapsulation Class Mysprite
Role move Thread class Spritemovethread
Role Change Frame Threading class Spritethread
Box Move class Boxthread
Thirdly, the system realizes :
first of all, the whole system is divided into four categories, the specific distinction is as follows:
Then the main process is the game interface related classes, the relationship of the internal classes are as follows:
Finally is the interface design, welcome interface is a mobile animation, the game interface in the implementation of the display, the menu interface includes four buttons, using the UML interface as follows:
Iv. System Testing
4.1 Unit Test
Welcome Animation Interface:
Menu interface:
Game interface:
4.2 Functional Testing
After testing, it realizes the functions of task moving and pushing box, and can be controlled by keyboard.
V. Problems encountered in the development and solutions
5.1 Android version issue
This game uses the Android2.1 version, first to download API21, then import the project will be error, and then download the appropriate API on it.
5.2 Keyboard Connectivity Issues
The connection to the keyboard changes the config configuration file. Locate the configuration file for the folder created by the emulator, which is the ADV folder inside the. Andriod. Open config file, change Hw.dpad=no to Hw.dpad=yes, save and exit, restart emulator.
5.3 Successful clearance issues
There is an error in the game is pushed to the box, no matter where to push the box, will show the end of the game, find the Boxthread class, add the following return false, so that only all the boxes have become green when the game successfully pass.
Vi. Summary
This project is to complete the Android platform-based push box game implementation, using the Android Studio development platform, to achieve a different 2.5D rendering technology new perspective. Completed the Welcome animation, interface design, game design and other aspects of the production, and solve the game development process of several problems, game function is basically developed completely, but there are still many places can be optimized and improved.
(1) the improvement of sound effects, in this game, not too much to add to the sound effects of processing, interested players can add some appropriate sound effects to enhance the player's experience.
(2) The player's customization, the game, should be added on the game difficulty of the selection function, so that players according to their own situation to choose different levels to play, so that more reasonable.
(3) The storage of the results, if you can at the end of the game with the game results of storage and ranking, that will greatly enhance the player's experience of the game, enhance the user-friendly game.
Finally, thank Lou teachers and students to give me the help!
Android Practice Project Report