(In terms of layout: we use a FrameLayout to position for sure, and put two child elements as big as the parent element in it. 2. Class design: The Snake game uses three main classes and two internal classes. TitleView: a game title class, which is your customized view. It refers to the methods related to Tile, such as the calculation of tiles, the definition of tiles, and the production of tiles. SnapView: It is a subclass of TileView and the main class of the game. Define the game status, operation methods, game rules, initialize the game, rewrite the view, manage the saved status when the game is paused due to a call, and recover the status when receiving the focus. Note that it is still a view. MainActivity: a game window class that serves as the loading and servicing of SnapeView. Snake. RefreshHandler: Handler class, rewrite ViewSnake. Coordinate: coordinate class to simplify the problem.
Lesson48_ Snake\bin\android\basic\lesson48\MainActivity.class
Lesson48_ Snake\bin\android\basic\lesson48\R$attr.class
Lesson48_ Snake\bin\android\basic\lesson48\R$drawable.class
Lesson48_ Snake\bin\android\basic\lesson48\R$id.class
Lesson48_ Snake\bin\android\basic\lesson48\R$layout.class
Lesson48_ Snake\bin\android\basic\lesson48\R$string.class
Lesson48_ Snake\bin\android\basic\lesson48\R.class
Lesson48_ Snake\bin\android\basic\lesson48\SnakeView$Coordinate.class
Lesson48_ Snake\bin\android\basic\lesson48\SnakeView$RefreshHandler.class
Lesson48_ Snake\bin\android\basic\lesson48\SnakeView.class
Lesson48_ Snake\bin\android\basic\lesson48\TileView.class
Lesson48_ Snake\bin\classes.dex
Lesson48_ Snake\bin\Lesson48_ Snake.apk
Lesson48_ Snake\bin\resources.ap_
Lesson48_ Snake\gen\android\basic\lesson48\R.java
Lesson48_ Snake\res\drawable\greenstar.png
Lesson48_ Snake\res\drawable\icon.png
Lesson48_ Snake\res\drawable\redstar.png
Lesson48_ Snake\res\drawable\yellowstar.png
Lesson48_ Snake\res\layout\main.xml
Lesson48_ Snake\res\values\strings.xml
Lesson48_ Snake\src\android\basic\lesson48\MainActivity.java
Lesson48_ Snake\src\android\basic\lesson48\SnakeView.java
Lesson48_ Snake\src\android\basic\lesson48\TileView.java
Lesson48_ Snake\.classpath
Lesson48_ Snake\.project
Lesson48_ Snake\AndroidManifest.xml
Lesson48_ Snake\default.properties
.....)