专业的手机游戏 手机软件下载基地

安卓软件|苹果软件|下载排行|最近更新

当前位置:首页软件教程电脑教程 → scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法

时间:2022-01-19 04:50:43人气:作者:紫枫下载我要评论

scratch走迷宫游戏脚本如何编程?喜欢迷宫游戏的小伙伴可以来看下scratch走迷宫游戏脚本编写方法,相信一定会帮到你们的。

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法

打开scratch2.0,进入它的工作界面;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法

选择从本地文件夹中上传角色;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

找到迷宫图所在的位置,在背景中导入迷宫图;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

将scratch默认的角色猫删除;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

点绘制新角色;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

定义好红色,选择圆形,画一个红色的小球;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

点脚本,进入脚本编辑区;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

点事件,将“当按下空格键”拖到右边的编辑区,并改为当按下上移键;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

在运动图标里,将面向0度的方向拉到下面,如图;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

将移动10步移到下面,并将步速改为2步;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

同样的方法建好向下、向左、向右运动的脚本;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

点绘制新角色,输入press spacebar to start;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

给小球添加脚本,在用户按空格键时,让小球定位在迷宫图的起点位置;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

继续添加脚本,控制小球的运动,如果遇到黑色就跳到起点,重新开始,如果遇到终点的蓝色就显示"you win!";

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

说明文字press spacebar to start的脚本如下;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

胜利文字“you win!"的脚本如下;

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

当按下空格键,小球来到迷宫的起点为,按上、下、左、右光标控制键,小球开始在人的指挥下运动,遇到迷宫壁黑色就跳回起点,遇到迷宫终点的蓝色就显示you win!

scratch走迷宫游戏脚本如何编程?scratch走迷宫游戏脚本编写方法截图

注意:

小球不能设为旋转模式,否则上下左右移动时会发生跳跃。

以上就是关于scratch走迷宫游戏脚本编写方法的全部内容了,希望对大家有所帮助。

相关软件教程

猜你喜欢

网友评论

关于紫枫下载 | 联系方式 | 发展历程 | 版权声明 | 下载帮助 | 广告联系 | 网站地图

Copyright 2017-2021 WWW.ZFJYCN.COM 【紫枫下载】 版权所有

声明: 本站所有软件和文章来自互联网 如有异议 请与本站联系 本站为非赢利性网站 不接受任何赞助和广告