Part 1 Objective
After you set Devices, Sprites, and Background, and write a game program, you can use Codey Rocky to play the game "Airplane War". This case is complex, so you can try the robotic cases first.
Part 2 Preparation
- Codey (robot controller) x 1
- USB cable x 1
- Computer with network access x 1
- Connect Codey to the computer by using the USB cable, open mBlock 5 (PC client or web version), delete the default device, click +add, select Codey from the Device Library and then click Set as mostly used device in the upper left corner, click Connect, select the Live mode, and then click Go to start the game.
- Set Airplane 6 in Sprite Library as my airplane.
- Set Airplane 15, Airplane 4, Airplane 22, Airplane 16, and Airplane 29 in Sprite Library as enemy airplanes.
- Add sprites: select Bomb from Props in Sprite Library to add the sprite Bomb.
- Add sprites: select Beaver from Animals in Sprite Library as the animal that announces the end of the game.
- Click Background to add a backdrop from Backdrop Library as the game backdrop according to the theme of the game.
- The Devices, Sprites, and Background added are shown in the following figures.
Part 3 Programming
- Set buttons A, B, and C on Codey Rocky as "Move up", "Move down", and "shooting" respectively.
- Write programs for the following sprites respectively: Airplane 15 (enemy airplane), Airplane 6 (my airplane), Bomb (Bomb), and Beaver (animal). The specific programs are as follows.
Enemy airplanes:
My airplane:
Bomb:
Animal that announces the end of the game:
Part 4 Practice
- Try to modify the costumes of the sprites in the game and select the sprites you like as sprites for the game.
- Try to modify the program to increase the difficulty and enrich the content of the game.
- Try to write a program for another game.
Comments
Please sign in to leave a comment.