Create & Learn
Background

Try Escape the Haunted Mansion for fun Scratch Project!

Escape the Haunted Mansion

Platform: Scratch
Level: intermediate

In this project, the Wizard must navigate through different rooms of the haunted mansion while dodging ghost clones. The player uses arrow keys to move the Wizard around the screen and must avoid touching any ghosts. When the Wizard collects a special item in each room, he can send a message to create a new ghost clone in a random position, making it more challenging. The goal is to survive for a certain amount of time or reach the exit before getting caught by the ghosts.

Save to Account
See All Projects

Backdrop And Sprite Images For The Project

background
background
1024 x 1024
Wizard
Wizard
1024 x 1024

Escape the Haunted Mansion: Solution Outline

These are the high level steps to create this project. Try to create the project on your own first as much as possible, before checking the detailed solution samples below.

  1. Create the Wizard character and set up basic movement controls.
  2. Design the haunted mansion backdrop and create ghost clones.
  3. Implement the special item collection and messaging system.
  4. Set up the win/lose conditions for the game.
  5. Add the exit and final victory condition.

Escape the Haunted Mansion Sample Solutions

This section provides detailed, step-by-step instructions on how to build the project. There are many ways to create a project, so feel free to explore different approaches. Please note that these instructions are Al-generated, so errors may occur and the coding blocks may not map to Scratch exactly. But it should serve as very valuable references. Stay attentive as you follow along, and enjoy!

Create the Wizard character and set up basic movement controls.

Start by creating a Wizard sprite. You can either draw your own or choose one from the Scratch library. Next, add scripts to allow the Wizard to move using the arrow keys. Use the 'when green flag clicked' block to initialize the Wizard's position and use 'when key pressed' blocks to move the Wizard up, down, left, and right.

Design the haunted mansion backdrop and create ghost clones.

Design a backdrop that looks like a room in a haunted mansion. You can draw spooky elements like cobwebs and old furniture. Then, create a ghost sprite. Use the 'when I receive' block to create clones of the ghost at random positions. Use a 'forever' loop to make the ghosts move around the room.

Implement the special item collection and messaging system.

Create a special item sprite that the Wizard can collect. When the Wizard touches this item, it should disappear, and a message should be sent to create a new ghost clone. Use the 'broadcast' block to send this message and the 'when I receive' block to handle the ghost creation.

Set up the win/lose conditions for the game.

Create variables to track the time the Wizard has survived and whether the game is over. Use a 'forever' loop to check if the Wizard touches a ghost. If so, end the game. Also, set a timer to determine if the Wizard survives long enough to win. Use 'if' statements to check these conditions.

Add the exit and final victory condition.

Create an exit sprite that the Wizard must reach to win the game. Position it in a challenging location. Use a 'when touching' block to detect when the Wizard reaches the exit and display a victory message.

Common Potential Issues in Escape the Haunted Mansion Project

It is common to have bugs in the code. Here are some of issues you might run into.

  • Ensuring the ghost clones move smoothly and don't overlap too much, which can make the game unfairly difficult.
  • Managing the timing of messages and clone creation to keep the game balanced and not too chaotic.
  • Handling the Wizard's movement to prevent it from getting stuck on the edges of the screen or other sprites.

Extra Challenges For Escape the Haunted Mansion

  • Add a power-up item that temporarily makes the Wizard invincible to ghosts.
  • Create multiple levels with increasing difficulty, such as more ghosts or faster ghost movement.

Learn Scratch Coding Skills

Enroll your child in award-winning online Scratch coding classes led live by experts and designed by professionals from Google, Stanford, and MIT.

Scratch Junior
Scratch Junior
Grades K-2
Start coding with ScratchJr, and make interactive stories and games
Learn More
Scratch Ninja
Free Intro
Scratch Ninja
Grades 2-6
Code games and animations with beginner-friendly Scratch coding
Accelerated Scratch
Free Intro
Accelerated Scratch
Grades 5-9
Fast-paced introduction to coding: build games, stories, and animations
Intermediate Game Building with Scratch
Intermediate Game Building with Scratch
Grades 3-6
Code a new fun Scratch game every week

Explore More Fun Scratch Practice

The challenge continues: Enjoy even more Scratch tutorials dreamed up by other students or use your imagination to make your own!

backgroundTry The Tutorial
Develop My Own Idea

Find Best Classes For Your Child

Explore your child's grade level to find computer science classes and learning pathways that set your student up for success.