top of page
Search
  • nathaliamccarthy

Moving Box

In the boxes below shows the code I used to create the moving box. Var are variable they're used to show value and used to display what is what. The createCanvas is used to create the screen size. Background is set to 0 that means the background would be black. Fill is use for colors, you use it to make whatever you want. Rect is to draw the square. MouseX and MouseY is use to for you to move the square as your mouse. When use conditional statement to make the square move by itself and change the color of the square when it hits the sides.




2 views0 comments

Recent Posts

See All
bottom of page