[Thread Prev] [Thread Next]
This is common problem for students.
Here is what you need to remember -
Every time the turtle takes a step he needs to check to see if he is
touching another turtle.
There are many ways to do this, here is one of them.
This can go in the frog's backpack.
If touching? "frogger "car1 [announce [you are squished]]
If touching? "frogger "car2 [announce [you are squished]]
I then put check in the onclick box.
Just remember this needs to happen forever.
So he takes one step and then he checks if he is touching anyone. This
is not pretty but it can work.
You can also program all the cars' backpacks, too.
Are you using backpacks?
Daniel's program is far more elegant than this one but it contains
variable which some of my students can not grasp at this stage. It
actually works to my advantage that they go through all the coding. When
they do learn variables, they can go back to frogger and change the
Like I said before, my website is a work in progress and I have lots to
Description: frogger example.mwx
Previous by thread:
MIA, Ask an Expert: touched reaction
Next by thread:
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.