
Create Your Own Virtual Pet Program with Micro:Bit Challenges
"Learn how to program a virtual pet using Micro:Bit, involving sound and light reactions, feeding, animations, and more. Complete bronze, silver, and gold challenges to enhance your coding skills. Explore extension challenges to further customize your pet program."
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Make a Micro:Bit Pet This week you be creating your own virtual pet program that reacts to sound and light, gets hungry, and likes to play. Whether programming in blocks, JavaScript or Python, please complete the bronze requirements before starting the silver, and complete the silver before starting the gold.
BRONZE Challenge: In your program you will need: 1. A message or image on start to identify the program. 2. A pet waiting animation in the forever loop. 3. To use one of the inputs to feed the pet. 4. A different animation for eating. 5. To react badly to loud sounds.
Important: You may start to see some unwanted behaviours with your animations clashing. By using our new if statement blocks, we can correct the issue and have the whole program stored inside a single forever loop. The image to the right shows how to include button A as a condition in an if statement inside the forever loop. Remember: Only use one forever loop.
SILVER Challenge: In your program you will need to add : 1. To show the pet fall asleep when it gets dark ( 70 in this case) 2. A variable for fullness that goes up one each time it eats 3. One of the inputs to show the fullness value 4. To react happily to really bright light (> 200 in this case) 5. A reaction to when the sound level gets too quiet
Important: Your program will work its way down the list of if and else if statements in the forever loop, it will run the first bit of code where the conditions are met and skip the rest. Think of it like a check list where once something has been done you return to the top of the list and start again.
GOLD Challenge: In your program you will need to add : 1. A different reaction to loud sounds when sleeping. 2. A maximum value of 5 for the fullness variable. 3. Have a fullness meter instead of the value show . 4. Refusal reaction to feeding the pet when fullness is 5. 5. Fullness meter going down over time.
Extension Challenge: What else can you add to this program? Below are a few ideas: Adding play inputs and reactions Adding a happiness meter Pet reaction when left starving for too long Pet reaction when unhappy for too long Having the pet grow as you look after it