Flash Player
This site makes use of the Macromedia Flash plugin to display videos.
Click here
to download the Macromedia Flash player.
Video Tutorials

Wherever you see the
eye icon
on this site,
it is a link to a video tutorial.
|
|
 |
Spread the Infection
The infection is spread by Devils contacting each other, so
we will set it up so that if a red and a black Devil collide,
the black one will change colour to red. Go to the Collisions
workspace. Look in My Blocks>Devils for the Collision
block and drag it out. Set up the collision as below.
Hint: You can use Ctrl-C and Ctrl-V to copy and
paste blocks. 
Both sections of the Collisions block are set up to be
identical, as it does not matter which Devil in the collision is
red, they both should become red afterwards.
Go to SpaceLand and test to make sure the collisions work as
expected. |
 |
Monitor the Infection
We will set up monitors to keep count of the healthy and
infected Devils.
Goto the Runtime area and drag in a Monitor block
(from Setup and Run)
Now add a count everyone with block. Then add
Color = black
Copy and paste the block. Change it to be Color =
red.
Rename one monitor Healthy and the other Infected.

|
 |
Devils Weaken and Die
Sick Devils get weaker over time. We will use a
variable to store the energy level for each Devil. For
sick Devils, we will repeatedly reduce this value by a small
random amount. When it reaches zero, the Devil will die.
 |
In the Devils workspace, drag in an agent number
block, and name it energy. This is our
energy variable. |
 |
Switch to the Setup workspace, and under My
Blocks>Devils, drag the set energy block into the
Create Devils action. Set the level to be 200. |
Go back to the Devils workspace, and we will create a
Procedure for Devils getting weaker, as below.

Finally switch back to the Runtime
workspace, and from My Blocks, drag a Get Weaker block
into the Forever loop.
|
|