top of page

Assignment P5 animation

  • Writer: Nicole Nitz
    Nicole Nitz
  • Apr 16, 2019
  • 1 min read

For this assignment we made a square that was able to bounce off of the top and bottom as well as both sides of the canvas and when the square touched the edges it changed color. The image of my code doesn't have the part where it changes color, but to explain the code, we made a canvas that was set to a certain size (600x600) and we set an x and a y axis. If the square went beyond 600 on the x or y axis we told it to turn in the other direction which makes it bounce off the edges. We also make the speed of x and y different so that it bounces all over the screen. If the speeds were the same the square would just bounce in the diagonal direction only.

Recent Posts

See All
Final Project Idea

For my final project I want to make an air hockey type of game but have it be single player. I want there to be a puck/ball and goal...

 
 
 

Comments


bottom of page