π οΈ Section project: the dog chases the cat
Section 7: Speed and bumpingLesson 7.4 Β· β± 10 min
π― Project goal
The cat walks slowly, and the dog runs fast behind her. When he catches her π₯: he stops and says βGot you!β, and the cat says βYou got me!β.
π Note
Add a character: tap β next to the characters and pick one. Tap a character to code it: every character has its own blocks.
π± Cat

- When π© is tapped
- Speed: π’ slow
- Move right β‘οΈ 14
- When it bumps into a character π₯
- Say π¬ βYou got me!β
πΆ Dog

- When π© is tapped
- Speed: π fast
- Move right β‘οΈ 1
- Start again forever βΎοΈ
- When it bumps into a character π₯
- Stop my other programs β
- Say π¬ βGot you!β
- Hop π¦


π Another example: a chase upwards
The same chase, but the cat runs away upwards with the dog behind her.
π± Cat

- When π© is tapped
- Speed: π’ slow
- Move up β¬οΈ 10
- When it bumps into a character π₯
- Say π¬ βYou got me! πΏβ
πΆ Dog

- When π© is tapped
- Speed: π fast
- Move up β¬οΈ 1
- Start again forever βΎοΈ
- When it bumps into a character π₯
- Stop my other programs β
- Say π¬ βGot you! πΆβ


βοΈ Practise
Make the cat faster so the dog never catches her. Who wins now?
βοΈ Practise here in the lessonβ Close the labor open the lab in a new page β
π― Challenge yourself
Easy
When the dog catches the cat, he hops twice for joy.
π Show the solutionπ Hide the solution
π± Cat

- When π© is tapped
- Speed: π’ slow
- Move right β‘οΈ 14
- When it bumps into a character π₯
- Say π¬ βYou got me!β
πΆ Dog

- When π© is tapped
- Speed: π fast
- Move right β‘οΈ 1
- Start again forever βΎοΈ
- When it bumps into a character π₯
- Stop my other programs β
- Say π¬ βGot you!β
- Hop π¦
- Hop π¦

Medium
Add a referee: the cat sends a message when she is caught, so Robo announces βThe dog won! πβ.
π Show the solutionπ Hide the solution
π± Cat

- When π© is tapped
- Speed: π’ slow
- Move right β‘οΈ 14
- When it bumps into a character π₯
- Say π¬ βYou got me!β
- Send a pink message βοΈ
πΆ Dog

- When π© is tapped
- Speed: π fast
- Move right β‘οΈ 1
- Start again forever βΎοΈ
- When it bumps into a character π₯
- Stop my other programs β
- Say π¬ βGot you!β
π€ Robo

- When a pink message arrives π©
- Say π¬ βThe dog won! πβ
- Hop π¦

Hard
Make the cat fast π and the dog slow π’, so the cat arrives and says βI escaped! πΈβ before he catches her.
π Show the solutionπ Hide the solution
π± Cat

- When π© is tapped
- Speed: π fast
- Move right β‘οΈ 12
- Say π¬ βI escaped! πΈβ
πΆ Dog

- When π© is tapped
- Speed: π’ slow
- Move right β‘οΈ 10
- When it bumps into a character π₯
- Stop my other programs β
- Say π¬ βGot you!β


