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:

http://scratch.mit.edu/

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.

http://www.wallpapers-room.com/2256/filter/popular/sports/1280x960/1/

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:

http://www.passyworld.com/Scratch/ShakeSound.wav

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:

http://info.scratch.mit.edu/Scratch_1.4_Download

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.

Enjoy,
Big Passy Wasabi

Scratch Random Numbers


Welcome to our Random Numbers Tutorial in Scratch.

Click the Green Flag to start the guys making some numbers, and then keep clicking the green flag to go again.

This tutorial shows a variety of ways we can make Random Numbers using Scratch. These numbers are handy to use in games we make to create interest and unpredictability.

The following YouTube video shows how our Random Numbers project was built.

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 are the variables that need to be created for this project.

Variables

Here is the Scripting for the Cat, who says numbers between 1 and 20.

Cat Script

The following is the scripting for the Starfish, who also creates numbers bewtween 1 and 20, but includes inbetween values like 6.5 and 17.5.

Star Fish Script

The script for the Squirrel creates numbers between 1 and 30 that are multiples of 3.

Squirrel Script

If you want to use our background to build your project, then here it is.
(Click on the picture and use your browser's save function, and then back arrow to return to this page).

Gym Background

As a challenge, modify this project to do the following:

The Cat says numbers between 20 and 40

The Starfish says numbers between 10 and 20 that have decimal values in one quarter increments such as:
10, 10.25, 10.5, 10.75, 11, 11.25.......19, 19.25, 19.5, 20

The Squirrel says numbers between 10 and 100 that are multiples of 10 such as: 10, 20, 30, 40, ......... 90, 100

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:


http://info.scratch.mit.edu/Scratch_1.4_Download

You'll definitely have some fun getting into random situations with Scratch.

Enjoy,
Big Passy Wasabi

Friday, May 27, 2011

A Muddy Friday Funny

Two girls in black mudpacks
Image Source: http://users.xcel.net.au

In our part of the world it has been raining all week and getting very muddy. So here is a dirty little Friday Funny that will slip by quite quickly.

Here at Passy World we love mountain bike riding, but Face Planting in mud certainly doesn't look like a good idea:

Bike mud face plant
Image Source: http://www.faillol.com

This little piggy went to market, and that little piggy stayed home; but this little piggy is a clean freak!

Pig in gum boots
Image Source: http://www.petsfunky.com

With winter sports we expect a bit of mud, but where's the boundary between a wet soccer pitch and a mud bath?

Muddy Girls Soccer
Image Source: http://www.haozuyupen.info

Motocross is a great mud sport, and this guy thought he'd get stuck right into it. (Obviously a "beginner boy").

Bogged Motocross
Image Source: http://static.blogo.it

Mud wrestling is of course the ultimate muddy messy affair.



Even the spectators of winter sports can't resist the fun, and happily get a splattering.

Muddy Kids sitting
Image Source: http://images.essentialbaby.com.au

If you really like what you've seen here, then the Louisiana Mud Fest in the American deep south needs to be your next holiday destination.



High heels and mud have never been a good combination, but this situation looks particularly nasty.

High Heels Bogged Car
Image Source: http://www.topcargallery.com

Here is some conclusive proof that four wheel drives are definitely NOT
"Go Anywhere" vehicles.


Bogged 4WD
Image Source: http://www.coolfunpics.com

Not exactly sure how these "mud pack" treatments are supposed to increase female beauty, as the before shots never look too flattering.

mud pack face
Image Source: http://attachments.techguy.org

Here's the latest all over "mud pack" beauty treatment for budding summer beach babes.

weird mud girls in africa maybe
Image Source: http://www.crazyfunnystupid.com

And here's how the girls looked at the end of that amazing process.

Bikini Babes
Image Source: http://www.topnews.in

That's enough mud slinging by us, time to go wash the car!

Enjoy,
Big Passy Wasabi

Friday, May 20, 2011

Schwarzenegger Friday Funny

Arnie sent to kill everyone
Image Source: http://1.bp.blogspot.com

Arnie has been going through a tough time lately, giving up Governor and ending his marriage. Now he needs to find some fresh new projects to work on.

Here at Passy World we have managed to uncover some exclusive information about what the shape and form of these new exploits might be.

First up, an exclusive interview with the man himself, concerning his latest "Clone" movie.



He has also been auditioning for a few talent shows around the world.

Here he is launching himself into a California Beach Boy romantic serenade.



Arnie has also been looking at crossing over into the Horror genre, as evident in this recent screen test.



However, we haven't heard anything to substantiate rumors of a "Conan II" movie anywhere in the near future.

Governer with Konan Sword
Image Source: http://images.icanhascheezburger.com

We do know however, that prior to his recent Divorce he was working with his wife and friends, on this Broadway extravaganza.



Somehow we don't think there will be "KIndergarten Cop II".

Who said KC sucked
Image Source: http://punditkitchen.files.wordpress.com

The following video is not really a humorous one, but is a brilliantly done animation, and so we just had to include it.



Finally, on a more serious note, as we do love the great man and all of his movies here at Passy World:

Top 25 Facts About Arnold Schwarzenegger

Arnold Schwarzenegger turned 63 on July 30 2010, and has packed an awful lot into his lifetime.

Born in Austria he first rose to fame as a world champion bodybuilder which led into a career as a movie actor in Hollywood. He is now the Governor of California with ambitions to one day become President of the United States.

An ambition that, given his past achievements, is well within his capabilities.

To celebrate his recent birthday here are some interesting facts about one of the most famous men in the world today.

His middle name is ‘Alois’.

He had an older brother, Meinhard, who died in 1971.

His father was a European ice curling champion.

He served in the Austrian army in 1965.

He won the Mr. Universe title five times and the Mr. Olympia title seven times.

He earned a degree from the University of Wisconsin.

He is a talented illustrator and painter.

He was the original choice to play “The Incredible Hulk” in the TV series.

He is nicknamed “The Austrian Oak”.

He has cast friend Sven-Ole Thorsen in 15 of his films.

He models himself politically after Ronald Reagan.

He managed a gym in Munich.

He has appeared in 28 movies.

He served 7 days in a military prison in Austria for going AWOL to compete in the Junior Mr. Europe competition.

He received $29.25 million plus 20% of the gross for Terminator 3: Rise of the Machines.

He was the first American private citizen to own a Humvee.

He owned the restaurant “Schatzi on Main” in Santa Monica, California.

He excelled in soccer and swimming as a child.

He is California’s 38th Governor.

He was founding partner in Planet Hollywood with Sylvester Stallone and Bruce Willis.

He works closely with the Special Olympics.

He buys carbon credits to offset the greenhouse gas emissions of his flights.

He has a tent outside his Sacramento Governor’s office where he can smoke cigars.

He holds an honorary Doctorate of Humane Letters from USC.

He left the Governor’s office in January 2011.

Source: http://www.inmycommunity.com.au/news-and-views/blogs/post/25-Facts-About-Arnold-Schwarzenegger/947/

So drop back in for another laugh next Friday, because......

We'll Be Back!


Enjoy,
Big Passy Wasabi

Monday, May 16, 2011

Scratch Car Race Game - Part 3


Welcome to the third and final part of our Car Race Game in Scratch.

Click the Green Flag to start and drive counter clockwise around the track.
Use the Up Arrow to accelerate forwards, and the Down arrow to reverse.
Use the Left and Right Arrows for steering, and Space Bar for brakes.
(The faster you go the tighter the steering, so be careful not to oversteer at higher speeds).

If you hit the grass, the car slows down dramatically.
The car has a limiter that slows it back down if maximum speed is exceeded.

Watch out for oil hazards on the USA Track!

The car is hard to steer once the speed gets up, and stays at a constant speed until you either brake or hit the grass. Concentrate mainly on steering with the left arrow key, and only tap the up key to go faster as you get better on each lap.

It is best to drive the car towards the middle or the outside of the track. Keep practicing until you achieve mastery. You can change the Car script to different number values if you don't like the game as it currently is.

The Car Race game is based on a game by "Spark98" called "Awesome Car Race" which we downloaded from the MIT Scratch site.

In the Part 3 build we add the following features to the Car Race Game:
  • Random Oil Slicks that spin the car around on the track
  • Display a Best Lap Time Value
  • Race only lasts for 10 laps
  • A "Game Over" Message
You need to complete the Part 2 tutorial, before building this Part 3 game.

The Part 2 game has an Introduction screen with a menu of three Race tracks that can be selected.

The Part 2 tutorial can be accessed by clicking the following link:

http://passyworldofict.blogspot.com/2011/05/scratch-car-race-game-part-2.html

The Part 1 tutorial can be accessed by clicking the following link:

http://passyworldofict.blogspot.com/2011/05/scratch-car-race-game.html

The following YouTube video explains in detail how to build Part 3 of the Passy World Car Race Game.

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).



In Part 3, the first thing we needed to do was create a 40x40pixel Oil Slick hazard to use on our track. This sprite was built using Adobe Fireworks and its Bezier Curves Pen Tool.

Here is the Oil sprite if you would like to use it in your project. click on it, and then save these to your PC using your web browser.

Oil Slick Sprite

The next thing was to import the Oil sprite into Scratch, and then create the Script for the Oil Slick sprite, so that it could appear every now and then on the USA track at various locations.

Oil Script

We then needed to add code to the Car Sprite, so that it could check if it was touching the Brown colour of the oil slick, and then go into a Spin momentarily.

Note in the script below, the "touching colour is actually dark brown, not black. Get a perfect match by using the scratch eye dropper selector and dip into an oil slick sprite on the track.

We have also modified the script to be slightly different to the one shown in the YouTUbe "How To" video.

Car Spin Script

The next thing we did was add a 10 Lap Limit to the race, and a Game Over Message.

In the Car Script we already had the lap counter variable being used, so all we had to do was Broadcast out a "Game Over" message, when the Laps reached 10 completed.

Car Lap Limit Script

The next step was to create the "Game Over" by using the Scrath Paint Sprite editor and putting in the "Game Over" text message using "Earwig Factory" font at a size of 60.

We then added the following Script blocks onto the "Game Over" sprite.

Game Over Script

The final item to add was the display of the Best Lap Time.

We needed to do this on the Car sprite, and add two new variables: "Best" and "Prev Best". The Car sprite code was then modified to contain the following additional new code.

Best Lap Script

So that's the Car Race Time Trial Game completed.

We did try to add some sound effects but were unable to find or make decent enough car engine sounds that would loop okay in Scratch.

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

http://info.scratch.mit.edu/Scratch_1.4_Download

You'll definitely have some fun Racing Cars with Scratch.

Enjoy,
Big Passy Wasabi

Sunday, May 15, 2011

Scratch Car Race Game - Part 2


Welcome to Part 2 of our Car Race Game in Scratch.

Click the Green Flag to start and drive counter clockwise around the track.
Use the Up Arrow to accelerate forwards, and the Down arrow to reverse.
Use the Left and Right Arrows for steering, and Space Bar for brakes.

(The faster you go the tighter the steering, so be careful not to oversteer at higher speeds). If you hit the grass, the car slows down dramatically.
The car has a limiter that slows it back down if maximum speed is exceeded.

The car is hard to steer once the speed gets up, and stays at a constant speed until you either brake or hit the grass.

Concentrate mainly on steering with the left arrow key, and only tap the up key to go faster as you get better on each lap.


It is best to drive the car towards the middle or the outside of the track. Keep practicing until you achieve mastery.


You can change the Car script to different number values if you don't like the game as it currently is.


The Car Race game is based on a game by "Spark98" called "Awesome Car Race" which we downloaded from the MIT Scratch site.

You need to complete the Part 1 tutorial, before building this Part 2 game. The above Part 2 game has an Introduction screen added to Part 1, with a menu of three Race tracks that can be selected.

The Part 1 tutorial can be accessed by clicking the following link:

http://passyworldofict.blogspot.com/2011/05/scratch-car-race-game.html

The following YouTube video explains in detail how to build Part 2 of the Passy World Car Race Game.

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).



In Part 2, the first thing we needed to do was create two more race tracks for the game; these being USA and Japan.

These were built using Adobe Fireworks and its Bezier Curves Pen Tool. It is important to use the exact same shade of green for the grass in these two new tracks, so that the Part 1 slow down in the grass script code on the car still works.

The flags used on the tracks, and on the opening menu, were saved off from Google Images, and then taken into Adobe Fireworks and resized to each be 100 pixels wide.

You will need to get your own flags from Google Images, edit and resize them, and then import them as Sprites into Scratch. You may also need to get your own finish line image from the web, if you have not completed the Part 1 tutorial yet.

Here are the three tracks used in our game. If you would like to use these same ones in your game, then you can click on them, and then save these to your PC using your web browser.

Race Track 1

Here is Track 2 - USA.

Race Track 2

Here is Track 3 - Japan.

Race Track 3

The next thing was to design the background of the Opening Screen Menu for the stage. This was done using the paint sprite function in Scratch, to paint bucket in a background, and then add some text, leaving room for the Car and Flag sprites to be positioned on this opening screen.

Menu Screen Bkground

The three tracks were then imported one by one, as additional backgrounds for the Stage, and named accordingly.

Part 2 Stage set up

The next thing was to set up the Car and Finish Line sprite sizes and positions on the Opening Menu Screen. Once we had moved them around with the mouse, we then noted down there x-y coordinates, and programmed these values into their Script code.

We then imported our three 100 pixel wide flags, as three separate sprites, into our Scratch project.

Now we can setup the script for each of these flags. The Japan Flag script is shown below, but all three are basically the same.

Flag Script

The Flag Script's main job is to broadcast a message to the Stage, so that it can change to the Race track for that flag's country.

The Stage then tells the Car and Finish Line sprites what country has been selected for racing.

Here is the completed Stage Script.

Stage P2 script

And here is the completed Finish Line script, showing how it resizes and positions itself depending on which track has been selected.

Finish Line Script

Note that the "Skid" sprite script has not been changed at all in Part 2, and is the same as it was in Part 1.

Skid Code

Finally the Car sprite. The new script code we have added for Part 2 is to position the Car on the Intro Menu Screen, and make sure it is not moving.

We then have code for when it receives the message that a certain country's race is starting, so that it is sized and positioned correctly on that country's track.

The rest of the Car Script is the same as it was in Part 1.

Here is the new script code for Part 2 that was added to the Car sprite.

Car Pt 2A Script

Here is the Car Script code from Part 1 that controls the movement of the car, and was moved to be under the above code as the next part of the Car Sprite script for Part 2.

Car Pt 2B Script

Here is the last part of the Car Script Code, taken from below the above code, which is the same code that we developed in Part 1.

Car Pt 2C Script

We obtained the Red Car from a YoYo Games forum on the internet, saved it, then cut it out of the Sprite sheet and resized it to around 50 pixels by 50 pixels.

Red Car Sprite

So that's Part 2 of our Scratch Car Racing Game.

In future extensions we are hoping to build in the following enhancements:

Sound Effects
Random Oil Slicks that spin the car around on the track
Race only lasts for 10 laps
A "Game Over" Message
Display a Best Lap Time Value
A Damage variable for when they hit grass

These enhancements are made in our Part 3 final Car Race tutorial. Click the link below to go to this tutorial.

http://passyworldofict.blogspot.com/2011/05/scratch-car-race-game-part-3.html

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

http://info.scratch.mit.edu/Scratch_1.4_Download

You'll definitely have some fun Racing Cars with Scratch.

Enjoy,
Big Passy Wasabi

Saturday, May 14, 2011

Survivor Friday Funny

survivors running down hill
Image Source: http://timetunedin.files.wordpress.com

We've all survived another joyous week, and for the weekend it's all downhill with nothing too challenging we hope.

That's right, this week we are all about being a survivor, the type that wins a TV competition and gets a million dollars. (The rest of us are all quite ordinary in comparison, right?)

Let's get into it with a quick video introduction to this week's latest episode.



It's not all coconut cream and bikini girls on Survivor Island, but contestants have been slow to take up some easy ways to make their stay more comfortable.

The Top 10 Overlooked "Survivor" Survival Strategies
  • Hide Richard's swimsuit; wait for teammates to puke to death.
  • Zealously guard your secret for fermenting coconut milk.
  • Join the Rat Tribe, lead an assault on the humans.
  • Step one: Plant lots of poppies.
  • Announce that if voted out, you immediately start humming "It's a Small World After All" or "Girl From Ipanema."
  • Secretly replace your Tribal Council torch with wacky self-relighting torch from novelty shop.
  • Legally change your name from Bob Smith to Zbiegniew Vladigmovski, then relax when it's time for everyone to write down their votes.
  • Employ the tried-and-true "Fart and Point at Someone Else" strategy.
  • Create dissension by encouraging one group to sing "...the professor and Mary Ann" and the other group to sing "...and the rest."
  • Gain popularity with the ladies by flaunting your nude fly-fishing technique.
  • Daily lattes from the island's newly opened Starbucks.

    and the Number 1 Overlooked "Survivor" Survival Strategy...

  • Begin nightly telling of your story about a group of people thrown together in the public spotlight and a bitter psycho loser who hunts them down and tortures them years later.
Source: http://humor.about.com

Star Wars fans, we haven't forgotten about you either, and there is an upcoming Survivor Series for you guys as well.



Bet you didn't know that there has also been a Survivor World Leaders Series.



There has even been a Survivor for Toys.

Survivor Toys

Have you heard about the Survivor "Young Versus Old" upcoming series?



Tribal Council is always an interesting affair.

Survivor Signs
Image Source: http://1.bp.blogspot.com

Here is a great video which shows exactly how Tribal Council works.



Here is some valuable information for Survivor contestants about how to avoid being the unpopular person who is voted off first.

Top 10 Reasons You're the Least Popular Survivor
  • Your Mr. T impression gets old after the first five minutes.
  • You're always asking your island mates: "Does this palm frond make my ass look big?"
  • You use your gourmet cooking skills to make dog food stuffed rat garnished with grubs and maggots - but nobody likes a show-off.
  • The coconut shell bra has its place - but that place is not on the body of a 6'4", 300-lb. programmer named Max.
  • You chopped down the island's only citrus tree to make room for your putt-putt golf course.
  • You insist on being called "Ginger" - even though your name is Tim.
  • Not only are you over the age limit dictated by viewer demographics, everyone is really getting annoyed at you for using your Swiss Army dentures to crack open coconuts, cut down trees, and gut fish.
  • Your irritating catch phrase: "Well excuse ME, Robinson Crusoe."
  • Your habit of overdoing it with the paprika is ruining the subtle taste of cooked rat.
  • You invented a coconut phone - only to spend hours placing telemarketing calls to the other survivors.
  • Your "coconut cream pie" specialty is nothing more than whipped seagull poop.

    and the Number 1 Reason You're the Least Popular Survivor on Your Desert Island...

  • Your favorite campfire song just happens to be "It's a Small World."
Source: http://humor.about.com

Prospective contestants have to submit a video to convince the Producers why they should be selected for the next series.

Here is a typical Survivor Application Video that we found on the web.



Here is another interesting amateur Survivor application video.




When it's all over and contestants return back to their normal lives, there is some intensive recuperation that needs doing.

Top 10 Items on the Return Home To-Do List
  • Show the judge your immunity idol and tell him to shove his fugitive warrant.
  • Borrow neighbor's weedwhacker; and cut your underarm hair.
  • Write up my experiences as a pilot for a TV sitcom about a diverse group of morons stranded on a tropical island.
  • Shower, shave, and do enough drugs until the image of Rich's naked body is no longer imprinted on your retinas.
  • Week 1: File lawsuit against producers claiming that you didn't know how much the media would invade your privacy.
  • Week 2: Appear on talk shows saying you knew it was a mistake as soon as you arrived.
  • Week 3: Sign contract for seven-figure nude photo shoot.
  • Come up with a couple dozen witty pickup lines involving the phrase "Tribal Council."
  • A quick visit to KFC for some *properly-cooked* rat.
  • Form an alliance with Pete in Accounting and Brenda in Marketing to try and capture all of the jelly donuts in the break room before 9:00am.

    and the Number 1 Item on the To-Do Lists of the Returning "Survivors"...

  • Set the alarm clock for 15 minutes and PAR-TY!
Source: http://humor.about.com

Finally, here is the Letterman Show's take on Survivor.

David Letterman's Survivor Top Ten List



When it's all said and done, Survivor is well summed up by the following poster.

Survivor Poor Countries Poster
Image Source: http://www.justsaypictures.com

Let's hope we can all survive till the next Friday Funny,

Enjoy,
Big Passy Wasabi

Sunday, May 8, 2011

Scratch Car Race Game - Part 1


Welcome to Part 1 of our Car Race Game in Scratch.

Click the Green Flag to start and drive counter clockwise around the track.
Use the Up Arrow to accelerate forwards, and the Down arrow to reverse.
Use the Left and Right Arrows for steering, and Space Bar for brakes.

(The faster you go the tighter the steering, so be careful not to over-steer at higher speeds).
If you hit the grass, the car slows down dramatically.
The car has a limiter that slows it back down if maximum speed is exceeded.

The car is hard to steer once the speed gets up, and stays at a constant speed until you either brake or hit the grass.
Concentrate mainly on steering with the left arrow key, and only tap the up key to go faster as you get better on each lap.

It is best to drive the car towards the middle or the outside of the track. Keep practicing until you achieve mastery.

You can change the Car script to different number values if you don't like the game as it currently is.

Our Car Race game is based on a game by "Spark98" called "Awesome Car Race" which we downloaded from the MIT Scratch site.

We obtained the Red Car from a YoYo Games forum on the internet, saved it, then cut it out of the Sprite sheet and resized it using Adobe Fireworks to around 50 pixels by 50 pixels. Note that it then needs to be further resized in Scratch, to make it a suitable size for the race track.

Red Car Sprite

Here is the Finish Line which we made using Adobe Fireworks with a Hard Line square paint brush tip.

Finish Line

The following YouTube video explains in detail how to build the Passy World Car Race Game using Scratch.

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 are the completed Script codes for the Car.

Note that it is very important that the "Speed" variable is defined as "For this Sprite Only", or it will not be accessible in the "Skid" sprite as a pull down in the blue block later on.

(Also Make sure in Scratch that the Rotation Arrow is enabled next to the image of the Car at the top of the Script, which is not shown here).

Car Script Code

Here are the Variables that need to be set up for this Game.

Variables

Note that the "Speed" and "Lap Start" variables have been defined as "For this Sprite Only", and not as the default value "For All Sprites".

This is why they appear under the dividing line on the variables list. The "Speed" variable must be set up like this to be accessable by the Skid Sprite with the coding we have used for the skid.

Ticks next to the Variables are made by clicking the mouse there.
These ticks make the current value of the variables appear on the screen. Note that we can move them around the screen to where we want them using the mouse, while we are building the game.

Here is the Script for the Skid maker when the car exceeds its maximum speed.

Skid Script Code

Here is the Finish Line Sprite Script.

Finish Line Code

Here is the Stage Script.

Stage Code

The following 480x360 JPG image is for our Race track if you would like to use it in your game.

Track 1 Stage

The track was built in Adobe Fireworks using "Bezier Curves" and some geometric shapes.
If you would like to learn more about Bezier Curves, then click the link below.

http://passyworldofict.blogspot.com/2010/06/fireworks-bezier-curves.html

So that's Part 1 of our Scratch Car Racing Game.

In future extensions we are hoping to build in the following enhancements:





  • Multiple Tracks to Choose From


  • An Opening Screen (where they can choose a Track)


  • A Damage variable for when they hit grass


  • Random Oil Slicks that spin the car off the track


  • Race only lasts for 10 laps


  • Sound Effects


  • Display a Best Lap Time Value


  • A "Game Over" Message
Click the following link to go to Part 2 of our Car Race Tutorial where we add an opening Menu and extra tracks to race:

http://passyworldofict.blogspot.com/2011/05/scratch-car-race-game-part-2.html

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:

http://info.scratch.mit.edu/Scratch_1.4_Download

You'll definitely have some fun Racing Cars with Scratch.

Enjoy,
Big Passy Wasabi