![]() ![]() We have therefore creating the illusion that key has been collected by the adventurer. If this condition is verified, the message ‘Open Door’ is sent to all elements, and ‘Key’ disappears. The program then checks constantly whether the ‘Key’ is touching ‘Adventurer’. The script will therefore be as follows:Ĭode explanation: when the green flag is clicked the sprite disappears. ![]() Next, we will make it so that when the adventurer touches the key, it disappears and sends a message to the door to tell it to open. when the backdrop changes), the key appears. These sprites are characters in your game, which can move around and execute code. Every entity in a Scratch project is a sprite. when the green flag is clicked, the key hides itself. To start coding in Scratch, we need to create something called a sprite. Add to the following blocks to the key’s script:Ĭode explanation: when the game starts (i.e. We want the key to appear only in level 2. ![]() You can draw them, choose them from the Scratch library or import them from your hard drive. How do you add difficulty to your game Creating different levels, using a timer, or. The second level will look like this:Īdd 3 sprites and give the name and the appearance of a key, a door, and a bat respectively. If touching red (meaning the ball moved past the paddle) the game ends. In order to improve what already exists, we will add a door which will open using a key and will give access to level 2, as well as an enemy in the form of a bat. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |