文档介绍:开始界面游戏的主界面是按钮图片,只是实现了界面的跳转, 此函数到让页面跳转游戏界面开始游戏, public class ZuomianActivity extends Activity{ protected void onCreate(Bundle savedInstanceState) { (savedInstanceState); setContentView(); }初始化方法,里面初始化了一些常量,字体颜色等 name="code" class="java">public MainView(Context context) { super(context); Resources resources =(); //Loading resources game =new MainGame(context, this); try {//Getting assets backgroundRectangle = (); lightUpRectangle = (); fadeRectangle = (); TEXT_WHITE =(); TEXT_BLACK =(); TEXT_BROWN =(); (()); Typeface font =((), "ClearSans-"); (font); (true); }catch (Exception e){("Error getting assets?"); }setOnTouchListener(new InputListener(this)); (); } 游戏界面游戏界面主要是在 中当前分数、最高分数、游戏区域、重新开始按钮、关卡选择按钮、帮助按钮,当跳转到游戏界面时就会调用并执行 函数来展示游戏界面。 protected void onCreate(Bundle savedInstanceState) { (savedInstanceState); setContentView(); }游戏界面的绘制***@Override protected void onSizeChanged(int width, int height, int oldw, int oldh) {(width, height, oldw, oldh); getLayout(width, height); createBitmapCells(); createBackgroundBitmap(width, height); createOverlays(); }.; import ; import ; import ; import ; import ; import ; public class MainGame {public static final int SPAWN_ANIMATION =-1; public static final int MOVE_ANIMATION =0