In this assignment you will create a simulation of the Etch-A-Sketch toy Suggested steps to complete this assignment
- Start a new program. Save your program with a meaningful name.
- In
setup()draw one rectangle that fills the screen and then a slightly smaller differently colored rectangle inside of it. Delete thebackground()indraw()and run your program. - Declare and initialize two global variables
x,yand and initialize them to the center of the screen. - In
draw()draw a small white circle at (x,y). - Add some
ifstatements:
- If key means "up", decrease y
- If key means "down", increase y
- If key means "left", decrease x
- If key means "right", increase x
- You can decorate your Etch-A-Sketch with the
text()function
