Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Adding Enemies | Developing an Adventure Game Catch the Carrot
Build Games with Cursor AI

bookAdding Enemies

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, we'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.

question mark

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

Select the correct answer

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 3

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Can you explain how the enemy movement works in more detail?

What happens if the rabbit collides with an enemy?

How does the restart process work after getting caught?

Awesome!

Completion rate improved to 6.67

bookAdding Enemies

Sveip for å vise menyen

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, we'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.

question mark

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

Select the correct answer

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 3
some-alt