Create a program that counts how many times you've clicked on the cookie
Draw a stationary ball in the exact center of the screen over a backdrop of any color.
- Each frame, you should:
- Set a background
- Draw an image of a cookie
- You can use an image of another object, but it must in a circular shape!
- Print out a message saying "Clicks: " in a font of your choice
Part B: Clicking Anywhere
Count how many times the user clicks the cookie
- Using a timer, make your program register a click every 8 frames
- Keep track of the number of user clicks in an integer variable
- Add that number to the message you display as text to the user (Ex: "Clicks: 72")
Make this game work a little bit better...
- The program only registers a click if you click on the cookie
- Hint: Write a method that checks the distance using the distance formula
- The program only registers a click if the user clicked, not if they hold down the mouse.
- Hint: Use a boolean to track if the mouse was pressed last frame. Do not use special methods like mouseReleased(), etc.
- When you click on a cookie, it should jiggle a little bit.
CREATE A FREE WEBSITE