Enjoying the preview?
This is the free first lesson. Get full access — request a demo or sign in.
Enjoying the preview?
This is the free first lesson. Get full access — request a demo or sign in.
You will create a Rock, Paper, Scissors game that utilizes graphics, where a random number generator allows the player to compete against the computer.
You will learn to import graphical resources such as JPEG files into the appropriate Android resource folder, access them from Java code, and manage the properties of an ImageView control.
The game score, computer choice, user choice, and other statistics are encapsulated in a single game state class variable, providing a demonstration of object-oriented programming techniques.
Lessons cover creating game graphics, building a layout for images and text, creating a common click listener, updating the TextView and ImageView on selections, handling computer choices, determining a winner and the score, updating the UI, and refactoring the app.