(NO.00003) iOS games simple robot projection game forming notes (11)
The robot has already fired bullets. Let's see how to set obstacles for players.
We can see from the figure above that there are several obstacles in the machine and basket. Let's first look at how to implement them.
Open SpriteBuilder and create SmallBrick. ccb in the Sprites folder. The type is Node.
Drag a CCNodeColor node from the control library, called the child node of its root node. Decorate the appearance according to your preferences and open the physical object. The physical type is static:
Create a new Levels folder and create a Level. ccb file in the folder. The file type is Node. First, drag a physical Node to its root Node.
Drag two robots to the left of the screen. One of the two robots is described above.
Place two obstacles in the center of the screen, and drag the rightmost side of the screen into a basket Node object. Note that these newly added objects are all child nodes of the physical node. The screen layout is similar to the following:
The object layers in Timeline are as follows:
Before you finish, set the code connection for the two robots in the basket: _ basket, _ robot1, _ robot2 for access in the code.