Skip to main content

Case 01: Get into Danger

Purpose


  • To create a magic wand that can beat over the spider.

Materials



Magic Wand Kit

Background


With the sound of footfalls approaching in a quiet and dark gorge, Xiao En and his partners have left their magic school and got here for the first time. Suddenly a pair of red eyes shining in the grass in the front of them, oh, it is a guard of the insects! Let's make a magic wand to expel the insects!

SoftWare


SoftwareMakeCode

Programming


Step 1

Click "Advanced" in the MakeCode drawer to see more choices.

We need to add a package for programming, . Click "Extensions" in the bottom of the drawer and search with "magicwand" in the dialogue box to download it. (Kindly note this package is still in the verifying process and pls search with "https://github.com/elecfreaks/pxt-magicwand " before it's ready)

Note: If you met a tip indicating that the codebase will be deleted due to incompatibility, you may continue as the tips say or build a new project in the menu.

Step 2

Drag and set the magic level block as primary; and set the infrared sending connection to P1.

Step 3

Drag the release magic once block into the while button P2 being pressed block as the picture shows.

Link: https://makecode.microbit.org/_E0Y7rg53hK46

You may also download it directly below:

Result

Press the button to activate the magic and if the moving spider was hit by the magic, it turns over and stops moving.

Exploration


How to play a sound while we use the magic.

FAQ


Relevant File