Video learning address:
How to play parkour games
Ada runs upAda is a character, how can he run? We clicked on the shape tab and found that Ada has four shapes. So what is styling? We all have many sets of clothes, and each change of clothes. We changed an image. Scratch's look is just like changing our clothes. It can have many images.
There is one in the appearance group Next lookBuilding block. Click on this building block Ada to change the look. We are findingRepeat executionBuilding blocksNext shape Eat the building blocks. Ada has a running animation.
Now Ada is still on the stage If it doesn’t move, we use the moving 10 steps blocks in the move group to make Ada move stand up. In order to prevent Ada from running so fast, we add another pause for 1 second 1 is changed to 0.05. At this time, Ada can run smoothly.
Stage edge verificationAfter Ada ran to the right side of the stage, he was blocked and would not look back. Let's realize the effect of Ada hitting the south wall and turning around.
First of all, every time Ada moves, we have to judge whether Ada currently touches the edge of the stage. This uses the control groupIf...thenBuilding block. This building block is similar to repeated execution. But there is a diamond-shaped condition .Find in the detection groupTotouch the mouse pointer put the building block in this diamond, click the down arrow tomouse pointerchangeedge of stage .
Ada’s positionAfter Ada hits the edge of the stage, he must go back Go to the left side of the stage. There is a move to x,y block in the move group. Thisx,y represents Ada’s position on the stage. Try to drag Ada with the mouse, you can find the next to Ada’s characterx,y is always changing. This changing number represents Ada's position.
We drag Ada to the left side of the stage, At this timemove to x,yThe number in the building block represents that Ada is on the left side of the stage Side position. We put this block insideif...then .Ada can move along the stage repeatedly.