How to Write Script to Make a Ball Move

Introduction: How to Write Script to Make a Ball Move

About: I am a 19 year old content creator and thb i forgot about this account and left it vacant for a while, and I realized how many views they were getting, so I want to continue to help you guys create, but i wa...

I am using The program from Khan Academy 
here is a link to it

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Step 1

To make the background color  simply type          background(0,0,0)
to change the color click on one of the zeros and  you can click on what color you want

Step 2: Step 2

To create the ball you need to type        ellipse(0,0,0,0)
the first  two zeros control where its placed on the page  aka the x and y axis
the second two zeros control how big the ball is
to control what color the ball is  put your cursor infrount of ellipse and hit enter  then go to the space above your ellipse and write fill(0,0,0)
it is the same way to change the color as the background

it should look like this

Tip: make sure you always have a semicolon ( ; )  after every command you type

Step 3: Step 3

you need to make a variable for the first  zero of your ellipse
type  var x = 17

Step 4: Step 4

How to make the movement of the ball
type                   var draw=       
2 brackets will come up copy and paste everything  in them except  the var  x = 17
 then at the bottom of the brackets (still inside the brackets) put
x = x+1
now your done you can see my creation on this link

if you liked this post please follow me to see more

Be the First to Share


    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Finish It Already Speed Challenge

      Finish It Already Speed Challenge