On mBlock 5, device programming is separate from stage programming.
Click the Sprites tab to start stage programming.
Create Your Stage
In stage programming, you can add backdrops, costumes, and sounds for a stage. In addition, you can design your own sprites.
A costume is the appearance of a sprite. A sprite needs at least one initial costume, and we can make the sprite move by adding multiple costumes for it.
Now, let’s make the house we have drawn smile by adding a costume for it.
1. Click Add Costume in the lower left corner or right-click the costume icon in the upper left corner and choose duplicate.
2. Draw the second costume and name it smile.
3. Click × to return to the editing page.
Now that the costumes are added, let’s start to program the sprite!
4. Drag the Events block when ( ) key pressed to the Scripts area.
5. Drag the Motion block change y by ( ) to the Scripts area.
6. Drag the Looks block next costume to the Scripts area.
7. Drag the Control block wait ( ) seconds to the Scripts area and set the time to 0.3 seconds.
8. Drag the Motion block change y by ( ) to the Scripts area and set the value to –10.
9. Drag the Looks block next costume to the Scripts area.
10. Press the space key and see what happens.