top of page
Blog: Blog2
Search

bouncing ball code

  • cory aberle
  • Apr 4, 2019
  • 1 min read

first I created the variable fr all of my basic reusable values like x, y, and their speed. the drew a black circle using those variables

made it so every time the code looks for an x or y value it is increased by 10 for x and 15 for y. after that I made if statements to top the ball at each wall using the size of the canvas and the radius of my ball and when the ball reached the wall I reversed the speed to the opposite direction ad changed the color


 
 
 

Recent Posts

See All
assignment 11

for my project I wanted to connect a nerf gun using the micro bit to a game on the computer but am having trouble with the connection it...

 
 
 
final project idea

for my final project i wanted to use the same style of code from my micro bit that i used for the final but instead of just lights also...

 
 
 

Comments


©2019 by Creative Coding: Art and Games Cory Aberle. Proudly created with Wix.com

bottom of page