Skip to content

Click Game

For this activity, create a program that lets the user enters a number of targets to hit. Then, show a window that displays the number of targets left to hit, using a health-bar style graphic (a partially filled bar, based on proportion of initial target remaining). Draw a circle on the screen, and test if the user has clicked the circle. When they do click it, subtract one from the targets to be hit, ending when this is 0.

Welcome to target click.
What is your target score: ten
Please enter a whole number
What is your target score: 10
Click 10 targets to end the game.
// a window opens, showing number of targets
// show target using a "health bar" style visualisation.
// draw a target circle...
// when it is clicked...
// Remove one from the number left to hit
// end when there are no targets left to hit