Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Adding Enemies | Developing an Adventure Game Catch the Carrot
Game Development with Cursor

Adding Enemies

Swipe to show menu

The field is no longer safe. Now the rabbit has to dodge moving enemies in each lane while trying to reach the carrot.

In this step, you're adding danger while still staying kid-friendly. Here's what changes on the play screen: Enemies in lanes.

  • Each horizontal lane should have an enemy (like a fox or a wolf);
  • Each enemy moves left → right → left in a loop, always sliding across its lane;
  • Enemies never stop, they keep drifting across on their own.

Collision rule.

  • If the rabbit touches an enemy, the run fails;
  • Show a friendly message like "Caught! Try Again" and a restart button;
  • After the restart, reset the rabbit back to the bottom of the field.

Winning still works.
Reaching the carrot at the top should still trigger the "You got the carrot!" message from the previous step.

Note
Prompt in Cursor

Add moving enemies to the play screen. Each horizontal lane should have a simple enemy (for example, a fox or a wolf) that moves left or right across that lane in a loop. The enemies should keep sliding across on their own without stopping. If the rabbit touches an enemy, the run fails, show a "Caught! Try Again" message and a restart button, then reset the rabbit to the bottom. Reaching the carrot should still show the win message like before. Keep everything kid-friendly, readable, and smooth on phones and laptops. Keep using emojis for now for both the rabbit, the carrot, and the enemies.

question mark

What happens if the rabbit touches an enemy in the app?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 3. Chapter 3
some-alt