If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Pixar in a Box

Make and save your own animation!

Use the program below to build your animation. Now you can move the ball anywhere as well as rotate it. Use the $x$ and $y$ avars to position the ball. Use the $s$ avar to control the stretch and squash, and use the $r$ avar to control the rotation of the ball.
• When you're happy with your animation press the Save button; this will bring up a black box containing the code for your animation.
• Copy all the text in the box and paste it here to create a new program.
• Then save that program.
Note: If you see an X and several A's on the last two lines, delete those.

## Challenges

• Can you make the ball look heavy?
• Can you make it look like a water balloon?
• Can you make it look happy?

## Want to join the conversation?

• How do you save?
• Click the save button. When you click that, a black box will appear with JavaScript code. Highlight everything and copy it.

Go to computer programming, click on JavaScript and click new program. You should now see a blank canvas. (Scroll 2/3 down the page)

Paste the code in this new program, hit save and name your program.

Your finished product should look like a mini GIF.

Hope this helps!
• how do you save?
• Press save and copy the code into a new java script program
• Who created animation, and how did they make it come to life?
• Charles Émile Reynaud I think.. and I'm not sure how they made it come to life.
• hi how can animate a new object
• The lesson will teach you - you can use Bezier Curves, which are curves that makes your animation realistic. Use the Pink dots to adjust. The Y is for height and the X is for left & right. To make the ball seem alive, you can stretch it while it's falling and squash it when it hits the ground. The r is for rotation of the ball.
• How do i animate my ball doing a 360 no scope and then making the ball teleport like a ninja
• u can,t boy u can,t!
• ¿Puedo modificar el código para cambiar la imagen?, es decir, ¿en vez de la pelota tenéis diferentes variables para cada personaje pixar o solo habéis hecho la varible ('pixar/luxoball') asociada a una imagen?
¿Si yo pusiera var ball= getImage('pixar/grandpaUp'); podría animar al abuelo de UP?
• No, no lo creo. Podrías intentarlo, sin embargo.
• how do you saeve this plz answer soon
(1 vote)
• Click the save button. When you click that, a black box will appear with JavaScript code. Highlight everything and copy it.

Go to computer programming, click on JavaScript and click new program. You should now see a blank canvas. (Scroll 2/3 down the page)

Paste the code in this new program, hit save and name your program.

Your finished product should look like a mini gif.