Unit 1 Lab 5

Follow the Leader

In many programs, the visual elements on the screen need to interact—follow each other, avoid each other, react a certain way when they meet each other, etc.

In this lab, you will program two sprites. One sprite will follow your mouse. The other sprite will chase the first. When they meet, they will have a short conversation.

BJC unit 1 Lab 5 Follow the Leader

Sprite Following the Mouse

u1l5 chunk 1 sprite following the mouse

Sprite Following a Sprite

u1l5 chunk 2 sprite following a sprite

Vocabulary

Click each word to view the definition.

Code Segment

A code segment is a sequence of connected instructions that carry out a purposeful action, such as the one pictured on the left, which animates a conversation. The instructions in the code segment are carried out in order, from top to bottom.