Swimming Fish

MicroWorlds

3
ways
to
swim
!

To start, open MicroWorlds

First, let's move the fish in one direction.

METHOD 1

Go to the next slide to begin

#1: Draw a fish

#2: Save fish as a shape + draw background.

#3: Hatch a turtle + give it the fish shape

#4: Set the turtle's OnClick rule to

                                                                   (Forever!)

#2: Se

fd 1 / 10

Right click turtle Open Backpack

#5: Test + experiment

#2: Se

In the command center, type                + enter

so the turtle faces to the right.

 

Click on the turtle. Does it swim?

Click on it again. Does it stop?

 

Go back to the OnClick rule (from last slide).

Try different fractions after         to change the

fish's speed.

rt 90
fd

#6: Add a 'swim' procedure + button

#2: Se

to swim
fd 1 / 10
end

Good job!
 

Now we will move the waves instead of our fish.

METHOD 2

Go to the next slide to begin

#1: Make a new page (don't worry, you won't lose the first page)

#2: Make waves + save to Shapes tab

#3: Draw a calm (flat) background ocean

#4: Set up turtles

#4: Ask the wave turtles to move

to waves
ask [t1 t2]
    [seth -60
     repeat 20 [fd 1 / 5]
     seth -120
     repeat 20 [fd 1 / 5]]
end

Write a 'waves' procedure to set the waves in motion. (Try different numbers!)

Make a 'waves' button and set it to forever.

Does the fish look like it's moving through the water?

*

*

Yay!
 

Now let's make the fish swim back and forth.

METHOD 3

Go to the next slide to begin

#1: Draw a new ocean on a new page

#2: Make a copy of the fish, and flip it

#3: Write a 'swim_and_turn' procedure

to swim_and_turn
setsh "fish1 seth 90
forever [fd 1 / 10]
when [(abs xcor) > 230]
     [rt 180 changeshape]
end

this procedure calls
another procedure

 

(we need both)

to changeshape
if shape = "fish1
     [setsh "fish2 stop]
if shape = "fish2
     [setsh "fish1 stop]
end

#4: Make a 'swim_and_turn' button

This button only needs to do it Once because the procedure makes it move forever

Congrats, you did it!

MicroWorlds

3
ways
to
swim
~

OWLET - [MW] Swimming Fish

By Michelle Lim

OWLET - [MW] Swimming Fish

  • 3,143