In-depth analysis of jetboy games (I)-Framework Analysis

Source: Internet
Author: User

The jetboy game is an example game in the android SDK. It took several days to analyze it and compile the game for the future.CodeAccumulated experience. We have introduced snake games.
This game is relatively simple, and jetboy is relatively complicated. It mainly tells us how to use the jetplayer class. This exampleProgramWe will divide it into three sections (Framework Analysis and jetplayer Class Analysis)
Core code analysis
In this article, we mainly analyze its framework.

Shows the game interface:



First, we will introduce the composition of the game interface: asteroid (minor, meteorite), ship (spacecraft), beam (laser beam), and others are backgrounds.
How does this game play? The intermediate button is used to control the spacecraft to launch a laser, hit the meteorite score, and the spacecraft's position is consistent with the latest meteorite level.
How can I switch the portrait of the game interface? I believe every developer should know this (CTRL + F12 )!

 

First, we will analyze the structure of the class, as shown in:



The main types are as follows:

Main Category Function Description
Jetboy Subclass of activity, game events
Jetview Game interface display
Jetthread Core Thread
Keygameevent One key event
Jetgameevent Events generated by a jet engine
Then, the analysis program processes user operations:

Finally, we analyze the game running process:

Summary

The entire program looks complicated. I am also analyzing the android SDK, and then sort out the code and use the Rational Rose tool to analyze the code framework. Through the analysis tool, we can block the "complex" Code (Code details), and the entire framework can be clearly displayed in front of us.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.