Friday, January 18, 2013

Spinning Ball

In this tutorial, we will cover how to make a ball sprite appear as if it were spinning!

Start with a fresh project. Delete any sprite that may already be there by right-clicking on it and selecting delete from the menu which appears, or by clicking the scissors at the top of the screen and then clicking on the sprite that you want to get rid of.
Now we need to make a new sprite. Select the "Paint new sprite" option from just below the stage.
You should get a window that looks like this.

Let's select the "Ellipse tool". Ellipse is a fancy word for circle that can also look like an oval.

Let's make sure our options for the Ellipse look like this. We want an outline circle in black. The outline option is the second of the two at the top.
Now we bring our mouse over to the drawing area. Hold down the Shift key and click and drag your mouse to create a circle. If you don't hold down the shift key you can still make a pretty good circle. Your circle should look something like this.
Next we want to get the "Line tool" to draw some sections on our ball.

In the drawing area, click the edge of your ball and drag a line across to make it look something like this.

Next we want to fill in those areas with some colors to make it look pretty. Choose the "Fill tool" to fill in areas with a color.
Choose one color to start, it can be whatever you want except black because our lines are black. 
Click in one of the open areas to fill it in with your new color. Pick two different colors and fill in the other two areas. Your ball should look something like this. Nice!
If your project looks like this now after pressing "OK" on your sprite editing, then you're right where you need to be! If not, look back through the directions to see if there was something you missed.
Now we want to do something to make it look like our sprite is a spinning ball. From the middle top of the screen, select the "Costumes" tab. Something that looks like this should come up.
We are going to make our ball look like it's spinning by switching between three different costumes. To make a new costume, click the "Copy" button. Make two copies. When you are done, it should look like this.
Next we want to change the way our other costumes look. Leave the first one alone and select the picture called "costume2." Press the edit button next to "costume2."
Using the same colors you did for the first costume, move them over one area by filling in that area with the next color. Your "costume2" should now look something like this. Notice how it looks different from the first costume we made?
Do the same to "costume3" to make it look something like this. We should now have three different costumes in one sprite. Now let's make it look like it's moving!
Make sure you are in the "Scripts" tab and not the "Costumes" tab. From the Purple Looks Menu bring a "next costume" script into the scripting area.
From the Orange Control Menu, bring over a "when 'green flag' clicked" script header, a "forever" script and a "wait (1) secs" script.Combine them so they look like this. The "forever" script just below the "when 'green flag' clicked" script header, and the "next costume" and "wait (1) secs" scripts within the "forever" script.
I decided to change the time to .5 seconds so that my ball would spin faster.
Press the Green Flag button. Congratulations, your sprite now looks like it's spinning!