scratch 爬坡赛车教程,scratch编程教程赛车

首页 > 游戏 > 作者:YD1662023-06-15 22:01:19

1)将鼠标光标放在赛车上。

2)在“Sprite”窗口的右上方上方查看赛车手的x和y坐标。

3)拖动“go to x: 16 y: 120”事件以适合“when flag clicked”事件。

4)双击“ 16”文本框,然后输入x值。

5)按Tab键,然后输入y值。

6)按↵Enter。

6.更改开始位置。从“Motion”菜单中拖动“point in direction 90”事件,使其适合“go to x y”框。 单击标志时,这将确保您的汽车朝向正确的方向。

scratch 爬坡赛车教程,scratch编程教程赛车(21)

7.指明要使用哪种costume。单击“Looks”,然后拖动“switch costume to costume2”以适应起始位置的下方,单击“costume2”框,然后选择“costume1”。当你重置游戏时,这会使你的赛车恢复到它的非碰撞costume 。

scratch 爬坡赛车教程,scratch编程教程赛车(22)

第四部分:创建移动规则

1.添加一个移动脚本。这是你的赛车手用来前进的脚本:

1)单击Events。

2)将“when flag clicked”事件拖到窗格上,与第一个“when flag clicked”脚本分开。

3)单击Control。

4)将“forever”事件拖动到“when flag click”脚本下方。

5)单击“Motion”,然后拖动“move 10 steps”选项以适合“forever”插槽。

6)将“move 10 steps”变量从“10”更改为“2”,然后按↵Enter。

scratch 爬坡赛车教程,scratch编程教程赛车(23)

2.创建controls。您将使用以下脚本为您的赛车指定转向controls:

1)单击Events,然后将“when space key is pressed”事件拖到窗格两次。 您应该有两个单独的“when space key is pressed”事件。

2)在一个“when space key is pressed”事件上单击“space”文本框,然后在下拉菜单中单击左箭头。

3)单击另一个“when space key is pressed”事件的“space”框,然后单击下拉菜单中的向右箭头。

scratch 爬坡赛车教程,scratch编程教程赛车(24)

上一页23456下一页

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.