Goal of the week:
1. Adroid Project Run-through
2. Read the Code
Specific operation:
1. Project run-through display
Game Start Screen
Game Content Interface
2, game-related class implementation
(1) public class
First introduce the game controller Tafanggameactivity class.
Frame construction of Tafanggameactivity class
Handler message processing mechanism
Database development of Game score records
Development of Game Archive and read File dialog box
Next introduce the game archive database Dbutil class.
Game Abstraction Storage
Game Read File
(2) Interface related classes
Welcome interface Welcomeview, main interface Mainmenusurfaceview, table interface Highjifensurfaceview,
Help interface Helpview, sound settings interface Musicsurfaceview and Game End Interface Gameoverview. Welcome territories
Face Welcomeview: When the player runs the game, the first entry is the Welcome screen of the game, when the game is opened
Entered the animation Welcome screen.
Main interface Mainmenusurfaceview: included game actions: Continue the game, new games, standings query,
Several options, such as background sound settings, help, and exit. Leaderboard Interface Highjifensurfaceview: Record game credits.
(3) Game interface Gameview and related classes
The above has been introduced in addition to the game interface other than the interface, the next will be detailed on the game software of the most important module game
Interface Gameview, the following steps to explain it.
Elf Monster Target class.
Arrow Tower Singlejianta class.
Arrow Shell class.
Elf Monster's birth--targetnumthread thread call
Arrow Tower control Launcher--shellnumthread Thread
Simulation of Game Map matrix
Place the tower to protect the castle
A monster in the blink of an--game crystal
1) Elf Monster target class
The main task of the game is to keep the elf monsters close to the main city, so the monster is the main body of the game, in order to achieve the monster spirit of the movement
Development of the monster's walk, direction of identification and other modules.
The Walk of the Elf Monster.
Determination of the direction of the Monster Elf's walk.
The image of the monster sprite is refreshed in different states.
The development of the Monster Elf Blood quantity module
2) Arrow Tower Singlejianta class
The above completed the Game of Monster Wizard Development, the wizard can walk, choose the direction and change with the direction of automatic turn, the following introduction
The game's other protagonist Arrow Tower, the game is divided into two types of arrows, different looks, the range of attacks differ, naturally to build different arrows
The number of money in the tower is also different.
3) Arrow Shell class
The above implements the game's most important two main characters Elf monsters and Arrow Tower development design, the following is to explain the connection of two characters
Bridge-arrow Shell class.
An introduction to the overall framework of the arrow Shell class.
Development of the walking process of arrows.
The arrow pursues the development of the direction problem in the monster elf process.
Collision detection of arrows and monster Elves.
4) Elf monster born--targetnumthread thread call
The above implements the Elf Monster Shell Development, through the new shell class can get different kinds of different blood amount of Monster Elf, the game as
A tower defense City game, must have an endless stream of monsters to attack until the city failed to stop the game, this section will be introduced in detail the monster elf
Control of production and quantity.
5) Arrow Tower control transmitter--shellnumthread thread
Above solve the game involved in the development of the Monster Wizard, the next question is the Arrow tower launch Arrow development process, during the game
There may be a considerable number of monster Elves passing through an arrow tower, and then there is a question in front of the Arrow Tower, which monster elf to shoot? The solution of this game
The solution is: always shoot at the front of the monster Elf in the range of the Arrow tower.
6) Simulation of game map matrix
We have completed the design and development of the main characters monsters, arrows and arrows in the game, and have taken the mathematical matrix to the layout of the game interface.
Knowledge, the game interface analogy into a matrix interface, according to the matrix set different numbers to draw different game scenes, the following describes the matrix interface in this game.
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,2,2,2,0,0,0,4,4,4,0,0,0,0,0,2,3,3,3,3},
{3,4,4,4,0,0,1,1,1,1,1,0,0,0,0,2,3,3,3,3},
{3,2,0,0,0,4,1,0,0,0,1,0,0,0,0,2,4,4,4,3},
{1,1,1,1,0,0,1,0,0,0,1,0,3,0,0,0,0,0,0,0},
{2,2,0,1,0,2,1,0,0,0,1,0,3,0,1,1,1,1,1,0},
{2,0,0,1,0,2,1,0,3,3,1,0,2,2,1,0,0,0,0,3},
{2,0,0,1,0,2,1,0,3,3,1,0,2,2,1,0,0,0,0,3},
{2,0,0,1,0,0,1,0,2,3,1,0,0,0,1,0,0,0,0,3},
{2,0,0,1,1,1,1,0,2,0,1,1,1,1,1,0,2,2,3,3},
{3,3,0,0,0,0,0,0,2,0,0,0,0,0,0,2,2,3,3,3},
{3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3}
7) Place the arrow tower to protect the castle
The development of Monster Elves, arrows and arrows has been implemented in several sections, but it has become a problem to be solved in what form to place the arrow towers.
This game takes the hand to drag the arrow tower to carry on the display, the operation not only is simple, the play is cool to match the majority of players ' wishes, the following step in detail explains this aspect
The content. The process of placing an arrow tower is a kind of singlegojianta.
Touch the selected arrow tower.
Screen to drag and drop the arrow tower.
Set up the arrow tower
8) in the blink of an ogre--game Crystal
We have completed most of the development work in the Tower defense game, in order to increase the game's playability, this game added the game Crystal module, by killing a certain number of
Monster Genie, the system will reward players a game crystal, the player touch the Crystal module on the screen can easily eliminate all the monsters in the game interface, of course, crystal skills do not
Can be used continuously, there is a skill CD, the effect of playing with the Hero Skills CD effect is consistent, the following steps in detail to explain its implementation process.
Game Crystal Drawing.
Game Crystal skill release.
Game Crystal skill effect development.
Texture cutting.
Android Project Development Week Four