Sunday, May 29, 2011

Scratch Magic 8 Ball

Welcome to our Magic 8 Ball Fortune Teller.

Type in your question on the screen and click the blue tick mark. Good Luck and we hope your dreams come true!

To make this fun game, we first checked out a few of the Magic 8 Ball projects that had already been uploaded to the Scratch MIT Community Site:

We then realised that our Project would require the following components:
  • A Good 480x360 pixel sized Background image
  • An 8 Ball image that had a spherical gradient on it to make it look 3D
  • A Blue Triangle graphic image that we could write "Fortune" messages on
  • A set of Fortune messages that we could include in our project
  • Code blocks to make the ball shake
  • A nice ball shaking sound effect
  • Code blocks to randomly choose and display a "fortune" message
First of all, here is a link to the "free for personal use" image that we downloaded. We then took this image into Adobe Fireworks, and resized, cropped, darkened, and painted over its 8 ball to hide the number 8.

We made our 8 ball image as a 420x420 sphere in Adobe Fireworks, and added a spherical gradient 3 D effect to it. Watch the "YouTube" video later in this post for information on how to do this.

Magic 8 Ball PNG

The small blue triangle took a few tries to get the right size, but we ended up with this 108x86 image. We made the triangle in Adobe Fireworks, using the Polygon Tool set to sides = 3, and added a gradient, and a light blue pencil outline.

Watch the "YouTube" video later in this post for information on how to do this.

Triangle Image

The shaking sound effect we exported out of a Scratch project by "dominic_hunter" that we downloaded from the MIT site.
We also got our basic script coding ideas from his project.

To Export a Sound out of a Scratch Project

Right click on the Speaker symbol next to the sound in the Scratch project, and then choose "Export Audio Files to PC". (We can also do this same thing for Sprites and Images while on their "Costume").

We have placed the .WAV sound file at the following link:

If you click the above link, you should be able to play the sound with Windows Media Player. In WM player you can do "file > save as" to get a copy of it onto your PC.

However, if the sound plays in Quicktime when you click the link, then you will not be able to save it. You need to remove Quicktime as being your default audio player.

There is an excellent step by step article on how to do this at the following link:

Click here for How to Deactivate Quicktime as Default Player

Fortune Messages

Here are some fortune messages that can be used in the project.

( The / indicates a line return )

  • Definitely / yes
  • Without / a doubt
  • Try / again
  • Outlook / good
  • Ask Nostradamus / he might / know
  • Nostradamus / I am not. / Try / Again
  • It is / certain
  • My Reply / is No
  • Yes It is / decidedly / so
  • Yes
  • Reply Hazy / Try Again
  • No
  • Ask again / later
  • Sorry but / No
  • Cannot predict / at this time
  • My sources / say no
  • Most / Likely
  • Very / Doubtful
  • Don't count / on it
  • Probably / yes

Watch the "YouTube" video later in this post information on how to place each message into a blue triangle.
For the message font we used Arial Rounded MT Bold Bold size 14 or 18.

Creating all the costumes and graphic images, and getting them the right size, ended up taking a lot more time than creating the script blocks.

The following YouTube video explains in detail how to build the Passy World Magic 8 Ball Fortune Teller.

Note that by adjusting the bottom right hand controls, it can be viewed full screen in HD. (Press Escape to return to this blog page when finished).

Here is the Script blocks setup for the Stage.

Stage Sprite

Here is the scripting for the 8 Ball sprite.

Ball Sprite

The scripting for the Fortune Message triangle sprite is very long, but quite repetitive.

Here is the first part of the Fortune Answer sprite.

Answer Sprite PtA

And the scripting repeats as we go through all the fortune answers, and ends like this.

Answer Sprite PtB

The "Click for Next Question" message sprite requires the following scripts.

Next Question Sprite

So that's it for our Magic 8 Ball Project.

Make sure you give our tutorials a go, by downloading and installing the Scratch Development Environment for free on your PC from the following link:

When we asked the Magic 8 Ball if it had been a good project, the answer was:

"Definitely yes".

May good fortune be with you always.

Big Passy Wasabi

No comments:

Post a Comment