AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Why is there no clone block on scratch11/19/2022 ![]() ![]() Fill out the x and y co-ordinates so the block reads go to x: 0 y: -128: Go back to the Motion blocks and drag the go to x: y: block onto your script above the forever loop. Resetting the Sprite's Position When the Flag is Clicked Let's get it to go back to its starting point whenever the project is launched. If you click the flag again, nothing happens, as the sprite is already off the edge of the screen. Now click the green flag and you'll find that it moves off the edge of the screen and disappears. Open the Control blocks and drag the forever block to the script so it wraps around the motion block: Let's make the starfish keep moving forever. Click it a few times, and eventually the starfish will disappear off the side of the screen. The starfish will move sideways for a bit, and then stop. Open the Motion blocks and drag the move 10 steps block to your script, putting it in place beneath the event block you just added: Let's make the starfish move across the screen with a Motion block. This is how any project starts, so you'll always need to use this block on at least one of your assets. ![]() This will make the script start when the user clicks on the green flag. The first thing any script needs is an event to kick it off.Ĭlick on the Events blocks and drag the first block onto the scripts pane ( when green flag clicked). So start by selecting that sprite (Sprite 3 in my project). We're going to create a script for the starfish sprite to make it move across the screen. Now it's time to create that first script. Rename it and you're good to go! Creating a Script for a Sprite Scratch will save a duplicate of my project as a new project in your account. Log in to Scratch and go to the page for my project on assets:Ĭlick the See Inside button to view the project: In the toolbar, click File > Save as a copy: Make sure you've clicked the See Inside button so you can see the workings of the project. Open Scratch and go to the project you want to duplicate. Here's how you do each of these (you'll only need to do one). Clone the project I created to support the last tutorial.Īlternatively you can just carry on working in the same project you already created.Open the project you created for the last tutorial and make a duplicate of that.We'll use the assets we created and add a script to one of them.ĭepending on whether you worked along with that tutorial, there are two ways to get started for this tutorial: We're going to be working with the project created in the second part of this series, which was all about assets. a web browser with access to Scratch (I recommend using a modern browser like Chrome, Firefox, Safari or Opera for the best experience).Scripts are what make things happen in Scratch without them the assets would just be static images (or sounds) on the stage. In this tutorial we'll combine assets and blocks to make a script. In earlier tutorials in this series, you learned about assets in Scratch and about the different types of block available to you. ![]()
0 Comments
Read More
Leave a Reply. |