Kids Coding Project: Code your own candy collection game
campk12
Take me back to campk12.com - Global Online School for 21st century skills
campk12
candy collection image

Create Your Own Candy Collection Game!

Project description: Let’s use Hatch Kids to build a candy collection game in which our player avoids terrible poison and collects candy! 

Recommended ages: 6-9 years | Experience level: Beginner | Platform: Hatch Kids | We will use: Block-based coding | Recommended time: 30 minutes

STEP 1: Sign up for Hatch Kids 

Click Here to go to Hatch Kids

Select “Code with Blocks”  as shown in the screenshot.


You are now ready to begin creating your project!

STEP 2: Design your game

1. Choose a template and get started.

  • You can choose any template from the various templates shown above to create your own project!
  • For this project, we have picked the ‘Castle’ template.


2. Let’s design our environment before coding!

  • Designing involves the addition of 3D models to our environment. 
  • Click on the ‘Design’ section and add 3D models using the ‘Add 3D objects’ button as shown below.


3. When you select the Minecraft Castle template, the MinecraftAvatar is added by default.


4. Add a poison and a lollipop 3D model in front of the MinecraftAvatar.


5. Use the Translate button to position the 3D models in front of the MinecraftAvatar.

Final design view:

STEP 3: Let’s code!

Our Minecraft Avatar likes candy, but doesn’t like poison. When it finds candy, it gives a happy response, and when it finds poison, it gives a sad response.

Remember what we need to do!

  • From the ‘Events’ section drag & drop the ‘When play button clicked’ block to the coding space.
  • This block is used to start an event, in this case, our project will start when the player clicks on this play button.

Speak block:

  • From the ‘MinecraftAvatar’ section, get the ‘MinecraftAvatar say __ for _ sec’ block.
  • Make the avatar say “Let’s collect the candy” & “Let’s avoid the poison”.

Collision with candy:

  • From the ‘MinecraftAvatar’ section, drag & drop the ‘When MinecraftAvatar collides with __’ . 
  • From the ‘Lollipop’ section, get the lollipop block and attach it to the collision block mentioned above.
  • Make the MinecraftAvatar say “Yay! Thank you for the candy!”

Collision with poison:

  • Collide with the poison in the same way as mentioned above and make the MinecraftAvatar say “Oh no! Not the poison!”

STEP 4: Save your work and download the app!

Make sure you save your work by hitting the “Save” option shown in the screenshot below.

  1. Click on “Publish.”
  2. Fill the relevant details about your project
  3. After publishing, you will receive a QR Code. Keep this open for now.
  4. To enjoy your game, you will first need to download the free Hatch XR app on Play Store or App Store on your mobile phone.
  5. Once downloaded, open the app, scan the QR code on your laptop browser, choose the AR option and enjoy!


STEP 5: Share your project with friends and family!

Impress your friends and family by sharing the project with them. Show them your unique candy collection game, and invite them to create similar projects of their own using the Hatch Kids platform!

Wait, can you do more?

  • Yes! You can add a lot more things to your project.
  • You can add more poison and candy 3D models with varying points attached to them
  • You can also add a scoring system on your own when the 3D items are collected!
  • Add a conversation between two 3D models before the game starts!
Does Your Child Love To Create And Innovate?

Channel your child’s creative ability through our coding & game development classes.

Only few slots left, Hurry book your slot now!
Does Your Child Love To Create And Innovate?

Channel your child’s creative ability through our coding & game development classes.

What you should Read Next

Should I Homeschool My Child: Pros & Cons

Should I Homeschool My Child: Pros & Cons

Homeschooling as an idea has been around for years, but has picked up popularity since the start of the COVID-19...

Coding DIY Project: Fireworks

Coding DIY Project: Fireworks

Project description: The 4th of July is almost upon us and let’s celebrate it in code as we do it...

8 Narrative Writing Prompts To Inspire Your Kids (ages 7-10)

8 Narrative Writing Prompts To Inspire Your Kids (ages 7-10)

This narrative writing exercise is a great way to help kids express themselves, and get creative with different characters and...

Categories

Explore content in our most trending categories

FAQ

Augmented reality is an interactive experience of a real-world environment where the objects that reside in the real world are enhanced by computer-generated perceptual information, sometimes across multiple sensory modalities, including visual, auditory, haptic, somatosensory, and olfactory.

Virtual Reality (VR) is the use of computer technology to create a simulated environment. Unlike traditional user interfaces, VR places the user inside an experience. Instead of viewing a screen in front of them, users are immersed and able to interact with 3D worlds. By simulating as many senses as possible, such as vision, hearing, touch, even smell, the computer is transformed into a gatekeeper to this artificial world. The only limits to near-real VR experiences are the availability of content and cheap computing power.

Hatch Kids is the children’s version of Hatch XR, a free 3D creation platform where kids can learn to code and build virtual reality projects and games.

Hatch XR is a free 3D creation platform that allows you to  design and code virtual reality projects & games!

Hatch XR is the most powerful and easy-to-use AR/VR builder available. You can add physics and animations to your scene without needing to code, in just a few clicks. Then, add JavaScript code to your 3D objects if you want any custom / advanced behavior using our powerful Code Editor. Finally, publish your app and you’ll get a unique QR code that you can then scan with this AR/VR mobile app and bring your Mixed Reality scene to life on a surface near you.