Moving bacteria

In Project 1 we introduced Phil, an important white blood cell in your body. In addition to your human cells, your body also contains many non-human cells called bacteria. In Project 2, we'll teach a bacteria to move around on its own in random directions.

Did you know that there are more than ten times as many bacterial cells in your body as human cells? Some bacteria cause disease, while other bacteria work together with your cells to help your body. While your body has about 37 trillion cells, bacteria are single-cell organisms. You can learn a bit about bacteria in this video:

Moving to the right

  1. Open the Scratch Project "moving bacteria" (https://scratch.mit.edu/projects/138136332), select "Remix". If you don't see the Remix button, make sure you've logged into your Scratch account first.
  2. Drag out the below blocks from the Events and Motion categories, then snap them together.
  3. Now, the bacteria should move right when you click on the green flag at the top of the stage.

Moving in random directions

  1. Drag out the below blocks from the Operators and Control categories.
  2. On the "pick random" block, change the "10" to "360". Then snap this "pick random" block inside the "point in direction" block to replace the "90". This will make the bacteria move in a random direction instead of always going to the right.
  3. Snap the "wait" block to your other blocks.

Keep moving

  1. Snap the "forever" block below the "when flag clicked". This will make the "forever" block wrap around the other blocks, making them repeat forever.
  2. Click on the green flag to start your project. Sit back and relax, watching the bacteria move around your screen!
  3. Click on "Save Now" to save your project.

Need more help? Check out an example completed project here: Example projects.

What should we change to improve this Project? What did you like best? Please let us know here: feedback form.

Ready for an even bigger challenge? In the next project, we'll combine Phil and the moving bacteria. Project 3