Repository navigation
views
Armin Jodat edited this page May 18, 2024
·
1 revision
The aa.android.views package contains the custom view components used in the AA Mobile game. These views handle the rendering of the game’s graphical elements and manage user interactions.
-
-
init(context: Context): Initializes the game view with the provided context, setting up necessary resources. -
onDraw(canvas: Canvas): Draws the game elements onto the provided canvas. This method is called whenever the view needs to be redrawn. -
onTouchEvent(event: MotionEvent): Boolean: Handles touch events, such as taps and swipes, and returns true if the event was consumed. -
startGame(): Starts the game, initializing or resetting game state as needed. -
pauseGame(): Pauses the game, stopping any ongoing animations or timers. -
resumeGame(): Resumes the game from a paused state, restarting animations or timers. -
stopGame(): Stops the game, performing any necessary cleanup. -
update(): Updates the game state, called regularly during the game loop.
-
These view components are integral to the game's user interface. GameView is the primary custom view responsible for rendering the game and handling user input. It interacts with other components to ensure a smooth and interactive gaming experience.