Case 15 - Online game "Airplane War"

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
  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.


  1. Set Airplane 6 in Sprite Library as my airplane.


  1. Set Airplane 15, Airplane 4, Airplane 22, Airplane 16, and Airplane 29 in Sprite Library as enemy airplanes.


  1. Add sprites: select Bomb from Props in Sprite Library to add the sprite Bomb.


  1. Add sprites: select Beaver from Animals in Sprite Library as the animal that announces the end of the game.


  1. Click Background to add a backdrop from Backdrop Library as the game backdrop according to the theme of the game.


  1. The Devices, Sprites, and Background added are shown in the following figures.



Part 3   Programming

Airplane War.mblock

  1. Set buttons A, B, and C on Codey Rocky as "Move up", "Move down", and "shooting" respectively.


  1. 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:67.png
Animal that announces the end of the game:69.png

Part 4   Practice

  1. Try to modify the costumes of the sprites in the game and select the sprites you like as sprites for the game.
  2. Try to modify the program to increase the difficulty and enrich the content of the game.
  3. Try to write a program for another game.


Was this article helpful?
1 out of 2 found this helpful



Please sign in to leave a comment.