# Case 01: Get into Danger ## Purpose --- - To create a magic wand that can beat over the spider. ## Materials --- ## Products Link --- [Magic Wand Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-magic-wand-kit-without-micro-bit-board?_pos=1&_sid=809c6b940&_ss=r) ## 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](https://makecode.microbit.org/#) ## Programming --- ### Step 1 Click "Advanced" in the MakeCode drawer to see more choices. ![](./images/magicwand_case_01_02.png) 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) ![](./images/magicwand_case_01_03.png) ***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. ![](./images/magicwand_case_01_04.png) ### Step 3 Drag the release magic once block into the while button P2 being pressed block as the picture shows. ![](./images/magicwand_case_01_05.png) ### Link Link: [https://makecode.microbit.org/_E0Y7rg53hK46](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 ---