🧠Concept

Pick the right answer.

Concept · Q1
When the enemy chases the player, what does it do each loop?
Concept · Q2
Which block checks if the player is near, so the enemy can start to chase?
Concept · Q3
The enemy has three modes: patrol, chase, and run away. What changes the mode from patrol to chase?
Concept · Q4
Why does the enemy turn right a little when it touches a wall?

👀Code Reading

Look at the blocks. Predict what happens.

Code Reading · CR1
What does this script do each loop?
when flag clicked
forever
  if <(distance to [Cat v]) > (150)> then
    set [mode v] to [patrol]
  else
    set [mode v] to [chase]
  end
end
Code Reading · CR2
What is the problem with this chase script?
when flag clicked
forever
  if <(mode) = [chase]> then
    point towards [Cat v]
    move (5) steps
    if <touching color [#333399] ?> then
      set [mode v] to [patrol]
    end
  end
end
Code Reading · CR3
What does this run-away script do?
when flag clicked
forever
  if <(mode) = [run away]> then
    turn right (pick random (1) to (30)) degrees
    move (3) steps
    if <not <touching color [#333399] ?>> then
      set [mode v] to [patrol]
    end
  end
end

🐛Find the Bug

Something is broken. Pick the fix.

This chase script should move toward the player only when the path is clear, and turn when a wall is in the way. But the enemy walks straight into walls. What is the bug?

when flag clicked
forever
  if <(mode) = [chase]> then
    point towards [Cat v]
    move (3) steps
    if <touching color [#333399] ?> then
      turn right (15) degrees
    end
  end
end

🛠️Build It

Pick a level. Build it. Check the boxes.

🧑‍🏫
For the teacher

Review the student's project, then check each thing they did.

Project Evaluation

0 of 4 ticked

💬Talk About It

Present your project to your teacher or a classmate.

  1. 1️⃣Run your enemy near a wall shaped like a U.
  2. 2️⃣Point to where it gets stuck.
  3. 3️⃣Say one block you would add to help it escape.
🧑‍🏫
For the teacher

Watch the student present, then check each thing they did.

Presentation Checklist

0 of 4 ticked

📤Submit

Send your results to your teacher and parent.

0 of 0 answered