Home >Software Tutorial >Computer Software >How to create a plane war in Scratch How to implement the plane war mini game in Scratch
Scratch Plane War Mini Game Production Guide How to build an exciting Plane War game in Scratch? PHP editor Yuzai has compiled a detailed tutorial to guide you step by step to implement this classic game. Whether you are a beginner or an experienced programmer, you can easily master the production process. Continue reading the article to learn how to implement the Scratch airplane battle mini-game, and create your own sky battle with your own hands!
Scratch How to make a plane battle Scratch plane battle mini game
First add a background. In order to fit the title, the editor added a star background
Add two more variables, variable names For: 1P score, 2P score
First, import an aircraft character, and then delete the default kitten character (right-click), as shown below:
Then set up the aircraft separately Script: Use "When the... key is pressed" in . . . The form uses WASD to control up, down, left and right respectively: for up and down, use "increase y coordinate by 10" and "increase y coordinate by -10"
See the picture below:
In this way, the aircraft script is designed
Then design the missile script. This is the point. After importing the character of the missile, design two shapes, one is the initial shape and the other is the explosion shape. The missile script mainly allows him to follow the plane and press the J key to launch, as shown in the picture:
Repeat step 3
The script is designed as follows:
The rotation mode of aircraft and missiles is set to left and right rotation
上記はすべて、あなたに共有されたチュートリアルです。さらに興味深いチュートリアルは、PHP 中国語 Web サイトでご覧いただけます。
The above is the detailed content of How to create a plane war in Scratch How to implement the plane war mini game in Scratch. For more information, please follow other related articles on the PHP Chinese website!