JoC #5: If statements

    The sooner you fall behind, the more time you’ll have to catch up.
        — (unknown)

Continuing straight on from the last episode, we now make the turtle turn at the edge of the world.

Download video

Concepts discussed: method return value, boolean, if statement

Nothing to download – we continue with the scenario from last time.

 

Report post

12 thoughts on “JoC #5: If statements”

  1. This episode carefully explained why it was good to turn in small steps but not why it was possible for the turtle to apparently ignore the move (when it was at the edge of the world) and to carry out the turn. Perhaps a mention of this iin this episode would be helpful – even if it is already covered somewhere else.

    Report comment

  2. Yes, you’re right, sorry.
    The story is this: Actors cam, by default, not leave the world. If they are at the edge and attempt to move, the move will just hav no effect. (They are just pushing against a wall.)

    So the turtle actually tries to move at every step, but as long as it is facing the edge this has no effect. Once it has turned around sufficiently, the move works again.

    Report comment

Comments are closed.