Simple game flappybird production (1)

Today, let's briefly introduce the main parts of the game and the functions to be implemented by each part.

As shown in the figure, the entire project is divided into four main parts. The src/default package stores the source code of the program (is this nonsense), the img folder stores a bunch of pictures used in the game, and the wav folder stores The rec folder contains a text file that records the highest records the game has produced.

The program is divided into seven categories: AudioPlay, Bird, Ground, Num, Pipe, Start and World.
The AudioPlay class is responsible for the implementation of audio playback in the game; the Bird class is responsible for the realization of the bird pattern drawing and the bird flying up and producing dynamic effects, judging whether the bird passes through the gap of the pipe to score and judge whether the bird hit the pipe; the Ground class Responsible for the realization of ground drawing and dynamic effects; the Num class is responsible for the realization of the display of all digital information in the game; the Pipe class is responsible for the realization of pipeline drawing and dynamic effects, and realizes the randomness of the pipe center position within a certain range and the pipe gap size within a certain range Random within the range; the Start class is responsible for starting the drawing of the interface and the realization of dynamic effects; World, as the main class of the entire game, is responsible for the process control, image drawing, audio playback and the highest record read and write operations of the entire game. .

That's it for today, next time I will introduce the first class: the specific content of AudioPlay.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325476159&siteId=291194637