Scratch: Chapter 2 Quiz. This is the open book quiz based on the Chapter 2 readings from our Scratch Textbook. Questions: 15 Attempts: Last updated: Feb 13, Sample Question. Menu Bar. Sprite List. Scratch: Chapter 3 Quiz. Hamlin's Programming class. Questions: 20 Attempts: Last updated: Oct 26, This is also the point in front of which your car will start the race. Part 2. Click the "Paint new sprite" icon. It's a brush-shaped line in the upper-right side of the "Sprites" pane, which is in the lower-left side of the page.
Zoom in. If you didn't do it earlier, you may first have to close the "Tips" sidebar on the right side of the page by clicking the X icon in the sidebar's left-hand corner. Draw your racer. Using the brush, draw your racer however you like. If you're making a car, you might want to use the rectangle tool the rectangle-shaped icon to draw the body and then add the car's wheels with the circle tool.
Draw a crashed racer. Click the brush shaped "Paint new costume" icon below the "New costume" heading, then draw a crashed or otherwise different version of your racer. This is the version which will display if your racer touches the grass or any other obstacles you define later. For example, if your current racer is a happy face, you might make the "crashed" costume a sad face.
Select your first racer. On the left side of the pane in which you were drawing your racers, click the first one you drew. Drag your racer to the starting position in front of the finish line. You'll do this in the left-hand pane. Doing so will ensure that your racer is in the correct starting position when you go to create your script.
The racer will stop once it touches the finish line, so make sure the racer is in front. Part 3. Click the Scripts tab. You'll find this at the top of the Scratch page. Click Events. It's an option just below the Scripts tab. Doing so brings up a list of event-based code brackets. Add the "when flag clicked" event to the pane. Click and drag the "when [green flag] clicked" icon onto the right-hand pane, then release it there. Click Motion. This blue link is in the Scripts section.
Add your racer's starting location. This will determine where your racer starts whenever you begin a new game: Place your mouse cursor over your racer. Review your racer's x and y coordinates just above the upper-right side of the "Sprite" window.
Drag the "go to x: 16 y: " event to fit under the "when flag clicked" event. Double-click the "16" text box, then type in the x value.
Change the starting position. Drag the "point in direction 90" event from the "Motion" menu to fit under the "go to x y" box. This will ensure that your car is facing the correct direction when the flag is clicked. Indicate which costume to use.
Click Looks , then drag "switch costume to costume2" to fit below the starting position, click the "costume2" box, and select costume1. This causes your racer to revert to its non-crashed costume when you reset the game. Part 4. Add a movement script. This is the script which your racer will use to move forward: [1] X Research source Click Events. Jaron Lanier. Scratch Programming Racing Game Tutorial 1.
Getting Started Log in to Scratch, then go into your projects and create a new project. Making a Car Next, right click on the cat and click delete. Making the Car Move To make the car move, we need to drag some blocks to make some code. In the scripts tab of your car, use the blocks on the left of the screen to make this piece of code.
Each colored piece can be found in the different colored sections on the left. Making the Car Move Right click on the top of the group of code and click duplicate. Then, attach the new group of code to the bottom of the first group.
Making the Car Move To finally let the car move, make a new piece of code with a start block and a forever loop. Next, drag the code you put together before into the forever loop. Now, hit play and use the arrow keys to drive the car. Variables Variables store information that we can use throughout the game. For this game, we are going to use a variable named speed to change the speed of the car. Using Speed We want the car to slow down when it is driving off-road. To do this, we are going to make a new script that sets the normal speed when the game starts.
We also need to add speed into the movement code where 10 and used to be, and multiply speed by -1 to make the car move backwards for down arrow. Laps Draw a new sprite that can serve as a start line for your race. Make it just wide enough to cover the track left to right. Creating the Background or Stage. Click on the Stage option that is marked by the arrow in the picture below. Once you click on the Stage option, you will see 3 tabs in at the top in the middle section called Scripts, Backgrounds, and Sounds.
Click on Backgrounds and then click Edit on the plain background that is already there. Once you click on Edit the design window will open up again. From here, create race track. My race track example is shown below. Making Your Sprite Move. To make your race car move around, click on your race car sprite and add the blocks in the image below to your Script. Now you need to make your game more realistic by adding laps. To do this, you will need to create a new sprite racecar. If you are.
0コメント