Monday, May 28, 2012

Scratch Car Race Part 4

Welcome to Part 4 of our Car Race Game made in Scratch.

Click the Green Flag to start and then choose one of the three race tracks to use.

Use the following keys to drive 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 also 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.

Try holding down on the up arrow, and when the car gets too fast, you should see a pair of tyre skids appear which slow the car down.    

In this Part 4 of the Car Race we change the previous part's overspeed skids to be proper dual tyre skids, and we also add dual tyre skids to the car's brakes.     



 Producing Dual Tyre Skids
  Computer game Math 5
Image Copyright 2012 by Passy's World


Producing dual tyre skids proved to be the most challenging part of making the car game.

Skids are shown on the track for three seconds every time the car goes over its top speed of "7", and automatically applies its brakes.

A different pair of skids are also shown whenever we hit the space bar and apply the brakes.

All skid marks are cleared from the track at the end of each lap.

Making skids involves using (x,y) coordinates, Algebra, and Trigonometry.

The tyre skid needs to go in the opposite direction that the car is going in, so it would make sense to make the angle of the skid to be 180.

However we actually need to make the angle less than this, so that we can splay the skid direction out at an angle, and then use Sin and Cos Trigonometry to move the (x,y) coordinates of the skid to a position at the back of the car that will look like it came from the tyres.

For this reason, we need to have two separate skids that we run at the same time: a Left Skid and a Right Skid. Let's take a look at how we make the left tyre skid. Consider this diagram of the car.


Computer Game Trigonometry 1
Image Copyright 2012 by Passy's World


The (x,y) position of the car is located at the center of the car.

If we put the skid at a full -180 to the front of the car, then we will only get one tyre skid coming from the very middle of the back of the car.

If we set the skid direction as being -150, rather than -180 then we get the diagram shown above.

Angle A is the internal angle in our triangle, which will be 60 degrees, (because the other angle of the triangle next to white dot is 180 - 150 = 30 degrees). The yellow dot is where we want the (x,y) coordinates of the left tyre skid to be, relative to the white dot where the car center is.

To get the yellow dot's coordinates, we do some Trigonometry as follows :

x of skid = the x of the car + (sinA x the blue hypotenuse)

y of skid = the x of the car + (CosA x the blue hypotenuse)

The green line marked SinA in our car diagram will be negative because we are in the second quadrant of the Cartesian Plane.

The pink line marked CosA will be positive in this second quadrant.

This will have the effect of moving the white dot of the car, across to the yellow dot where we want the skid to be. The Car's X coordinate will have the green line length subtracted from it, and the y coordinate of the car's center will have the length of the pink line added to it.

Because Sin and Cos will have positive or negative values depending on which of the four quadrants the Angle of the skid is, this translation of coordinates works for the full 360 degrees of direction that the car can drive in.

This is very neat use of the Trigonometry of the standard 360 Degree Unit Circle.  

We write the processing into the Scratch Code with the variable "skidDir" to be the angular direction of the skid at any time. We then do the Trig Calculation in a very long piece of code at the bottom of this script.

Computer Game Math 7
Image Copyright 2012 by Passy's World

Here are the bottom of screen blue code blocks for the coordinates magnified to be a bit clearer:

Computer Game Trigonometry 2
Image Copyright 2012 by Passy's World
 




Computer Game Trigonometry 1
Image Copyright 2012 by Passy's World


The Right Tyre skid is made exactly the same way, except that we set the "skidDir" angle to be the car's angle +150, rather than -150.      


Detailed Instructions for Dual Skids

The following PDF document gives full instructions on how to make dual skids.


If you would like to have your own full size copy of this PDF, then simply click the save disk icon button on the PDF viewer, and you should be able to save it to your own hard disk.

Alternatively, you can view or save the full size PDF by clicking the link below:

Related Items

Scratch Car Race Part 1
Scratch Car Race Part 2
Scratch Car Race Part 3


Enjoy,
Big Passy Wasabi

Monday, March 12, 2012

Google Charts Interactive Graphs

Pic of Google Gallery Graph

“Google Chart Tools” makes very nice interactive mouse-over graphs for web pages.

Click the link below to access it.

http://code.google.com/apis/chart/interactive/docs/gallery.html

It is easiest to use the Gallery designs, and the HTML code can modified, and then cut and pasted into your website pages or Google Blogger directly. It should run the HTML and Javascript okay, and we get a really nice interactive graph that we can mouse over.

Pic of Google Gallery


Here is the HTML code for the example Pie Chart in the Google Gallery:

Example HTML Code


We want to modify the above chart to do results for our Car Colours in the Car Park Survey, which has this data:

Car Park Table

All we have to do is mouse select highlight copy the HTML code out of the Gallery, and paste it into a text editor such as Notepad, and edit it up like this:

Modified Code


Because we were not doing a full stand alone web page, we then further edited the above code to remove the HTML, body, and Head beginning and end Tags, before we put it into the bottom section of this blog post.

We then take this code and copy and paste it into a web page or Google Blogger post, and we will have our mouse over interactive graph.

Eg. Try mousing all over the graph below and observe what happens.



Note that we can only put one graph on a web page or Blog Post.

If we wanted more graphs on a blog post or page, we would probably need to build each one on its own separate page and then iframe onto each one.

Enjoy,
Big Passy Wasabi.

Tuesday, February 14, 2012

Free Online Integers Games

Nbr Balls Opening Pic

The above image is a screenshot from an exciting online Integers Game called "Number Balls".

This lesson contains plenty of online Integer games.

Use these games for practicing your skills with Integers.

For each game an image is shown that describes the game.

You can then click either this image, or the text link below the image, to play the game in a new browser window.

Many of these games are written in Adobe Flash and Java. Therefore they may not work on Apple devices.



Ordering Integers Number Balls

In this game we click the lowest Integer balls first, and keep clicking balls until they all are zapped.

We then progress to higher game levels that have more and more spinning balls for us to click on in the correct order.

Click on the image below, or the text link which follows, to play this game.

Nbr Balls Integers Ordering Game

http://themathgames.com/our-games/arithmetic-games/order-positive-negative-integers/




Ordering Integers Hats Game

In this game we click and drag with the mouse to put the number hats onto people in lowest to highest number order.

We then click on the "check" button when we are finished, and can use the right arrow to get another question to do.

Click on the image below, or the text link which follows, to play this game.

Integer Hats Ordering Game

http://www.primaryresources.co.uk/online/negnumorder.swf



Ordering Integers Space Race

This is a Space Invaders type game where we have to shoot the lowest Integer enemy ship, as well as avoid touching the other two enemy ships.

Use the left and right arrow keys to move, and the space bar to shoot.

Click on the image below, or the text link which follows, to play this game.

Ordering Integers Space Race Game

http://www.xpmath.com/forums/arcade.php?do=play&gameid=80




Ordering Integers Train Game

In the following game, use the mouse to put the three red Integer numbers in order onto the carriages and the train engine.

The biggest number always goes onto the steam engine.

It is very important to place the numbers exactly in the middle of the carriages and engine like this:

Pic of placing nbrs on train

Click on the image below, or the text link which follows, to play this game.

Note that you will probably have to page down the screen a bit to get to the actual game.

Integers Order Train Game

http://www.scweb4free.com/train1.html



Adding Integers Spider Match

This fun game helps us learn how to add Integers.

Click on a pair of numbered flies that add up to the required value in the center of the web and your spider should then eat them and give you a score.

Click on the image below, or the text link which follows, to play this game.

Spider Add Integers Game

http://www.arcademicskillbuilders.com/games/spider-match/spider-match.html




Adding Integers Orbit Integers

This is a fun space race, where we have to answer Integer addition questions correctly to power our spaceship.

Click on the image below, or the text link which follows, to play this game.

Integers Orbit Game

http://www.arcademicskillbuilders.com/games/orbit-integers/orbit-integers.html




Integer Warp Multiplying Game

This is a similar game to Orbit Integers, but has multiplying questions instead of addition.

We need to know our multiplying rules which are:

- x - = a Positive answer (Same Sign = Positive answer)


and

+ x - = a Negative answer (Different signs = Negative answer)

Click on the image below, or the text link which follows, to play this game.

Integers Warp Multiplying Game

http://www.arcademicskillbuilders.com/games/integer-warp/integer-warp.html




Minus Mission (The Slime Game)

This is not an Integers game, but is still fun, especially if we play it at the fast speed setting. It will certainly sharpen up your subtraction skills.

Click on the image below, or the text link which follows, to play this game.

General Subtraction Game

http://www.arcademicskillbuilders.com/games/mission/mission.html




Inequalities True False Game

In this game we drag each statement with the mouse and place it in the top of screen True or False box.

The game keeps score of our answers, and will not let an incorrect answer be placed into the wrong box.

Click on the image below, or the link which follows, to play this game.

Inequalities True False Game

http://www.kubbu.com/?s=inequalities-true-false




Add and Subtract Mystery Picture

In this game we find out what's behind the tiles, a bit like a jigsaw puzzle.

Click on the button with the problem then click on the result on the left.

If we are correct, part of the picture is revealed.

Add Subtract Integers Puzzle Pic

http://www.dositey.com/2008/addsub/Mystery11addsub.htm#s




Integer Operations Jeopardy Game

This game covers addition, subtraction, multiplication, and division sums.

You can play it alone or in teams.

To take our turn, we click on a points score box to get a question to do in the given category.

Click on the image below, or the link which follows, to play this game.

Int Ops Jeapordy Game

http://www.math-play.com/Integers-Jeopardy/Integers-Jeopardy.html




American Football Adding Integers Game

This fun game helps us learn how to add Integers.

A loss of years means a negative number, and a gain in yards means a positive number.

We click the mouse at the correct position on the number line to show the result of each world problem.

Click on the image below, or the link which follows, to play this game.

Gridiron Integers Adding Game

http://www.mathgoodies.com/games/integer_game/football.html



Line Jumper Adding and Subtracting Integers Game

In this game we are shown a number line.

We then click on the number line at the correct answer.

Click on the image below, or the link which follows, to play this game.

Add Subtract Line Jumper Game

http://www.funbrain.com/linejump/index.html




Walk The Plank Adding and Subtracting Integers Game

In this game we have to move our mouse over each of the Pirates, and they will each say a different answer.

We then click on the Pirate answer which we believe is the correct one.

Click on the image below, or the link which follows, to play this game.

Walk the Plank Game

http://www.math-play.com/integers-game.html




Subtracting Integers Car Racing Game

This game starts off with us using the left and right arrow keys to drive our car in a race, and then after a little while we have to stop and do an Integer Subtraction question.

If we get the question right, we get bonus items like a rocket booster pack to fly our car for a while, until the next question comes.

Click on the image below, or the link which follows, to play this game.

Subtracting Integers Car Race Game

http://www.math-play.com/math-racing-subtracting-integers-game/math-racing-subtracting-integers-game.html



Subtracting Integers Fish Game

In this fun game we have to click the letter that is the correct answer, before the fish swims to this correct answer.

Click on the image below, or the link which follows, to play this game.

Subtracting Integers Fish Game

http://www.slidermath.com/integer/SlamnS.shtml



Subtracting Integers Speed Test

This is more of an online speed test than a game.

However, it will certainly improve your Integer Subtraction skills.

Click on the image below, or the link which follows, to play this game.

Sub Integers Speed Test

http://www.basic-mathematics.com/subtracting-integers-game.html



Subtracting Integers Online Quiz

This online test will check how well we know our Integer Subtracting.

Click on the image below, or the link which follows, to play this game.

Sub Integers Online Quiz

http://www.aaamath.com/sub65_x4.htm



Integer Operations Stick Figure Battle

This game has levels that can be chosen at the start of the game and covers Addition, Subtraction, Multiplication, and Division of Integers.

Click on the image below, or the link which follows, to play this game.

All Ops Integer Fight Game

http://www.xpmath.com/forums/arcade.php?do=play&gameid=94



Multiplying and Dividing Integers Game

This is a kind of deal or no deal game quiz on multiplying and dividing integers.

Click on the image below, or the link which follows, to play this game.

Multiply and Divide Integers Game

http://www.math-play.com/multiplying-and-dividing-integers-game.html



Connect Four Game Using Integer Operations

At the start of this game we can choose what we want to include including addition, subtraction, multiplying, etc as well as the difficulty level.

Click the "Ready" button to get your question and start each move, and the "Answer" button to check each answer.

It is basically Connect Four against an opponent, and we need to get questions correct to drop our colored discs into the connect four.

Click on the image below, or the link which follows, to play this game.

Connect Four Integers Game

http://www.shodor.org/interactivate/activities/ArithmeticFour/



Moving Along Number Line Game

Move the helicopter to the same level as the pod to be able to shoot and destroy it.

It is a little bit tricky in that you click the sign button, then enter a number, then click Go.

Click on the image below, or the link which follows, to play this game.

Nbr Line Game

http://pbskids.org/cyberchase/math-games/space-coupe-rescue/


Hope you have fun improving your Integer Skills with this awesome collection of games.


Related Items

Introduction to Integers

Integers in the Real World

Integers in Drag Racing

Arranging Integers in Order

Adding Integers Using Number Lines

Adding Integers Using Zero Pairs

Subtracting Integers

Multiplying Integers


If you enjoyed this post, why not get a free subscription to our website.
You can then receive notifications of new pages directly to your email address.

Go to the subscribe area on the right hand sidebar, fill in your email address and then click the "Subscribe" button.

To find out exactly how free subscription works, click the following link:

How Free Subscription Works

If you would like to submit an idea for an article, or be a guest writer on our blog, then please email us at the hotmail address shown in the right hand side bar of this page.

Enjoy,
Passy

Friday, February 10, 2012

Mathematics of Aircraft Disasters

Pic of a Qantas 717
Image Source: http://www.aviationwa.org.au


This article has been transferred to "Passy's World of Mathematics" and can be accessed by clicking the link below.

http://passyworldofmathematics.wordpress.com/2012/02/10/mathematics-of-aircraft-disasters/





Note About the "Friday Funny"

Here at Passy World we are very busy, especially working on our new website: "Passy's World of Mathematics".

http://passyworldofmathematics.wordpress.com/

This means that we are no longer able to produce a regular "Friday Funny".

We hope you have enjoyed the many Friday Funnies that we have made over the last 18 months, and you can still view old editions by searching for them using our site' s right hand side search box, and then viewing on search results by scrolling to the top of the page.



Enjoy,
Big Passy Wasabi