Today we are going to make a drawing with sprites. We will be using the stamp block from the pen category. We will also be using a conditional statement to find out when one sprite collides with another.
Step 1. Setting up our scene
Delete the cat sprite from the sprites pane.
Hint: right click on the sprite in the sprites pane!
Click on the icon below in the sprites pane. Add a sprite.
Click the icon below again on in the sprites pane. Add a backdrop.
Hint: If you want to make your background a single colour click the paint brush icon. Use the paint bucket tool to colour the background.
Step 2. Move the sprite with the mouse pointer
Add this script to the sprite.
Step 3. Make your sprite stamp
Add these blocks to the sprite.
Hint: You will find these blocks in the Pen category.
Step 4. Change the colour effect
Add this block to the sprite.
Step 5. Add a new sprite
Click on the icon below in the sprites pane.
Add another sprite. This sprite will be the obstacle sprite. When it collides with the first sprite it will bounce.
Step 6. Make your sprite move
Add this script to make the new obstacle sprite move.
7. Make your obstacle stamp
Add these blocks.
Step 8. Make the obstacle bounce off the first sprite
Add these blocks.
Hint: This makes the obstacle sprite turn around when it touches the first sprite!
Step 9. Going further
See what other things you can get your sprites to do! Here are some ideas if you are stuck:
change effect byblock in the looks category. See what cool effects you can make.
See if you can add a variable that controls how fast the sprites are moving when you press the up arrow!
Make more obstacle sprites by duplicating. Hint > Right click the sprite’s thumbnail to find the duplicate option.