| 拿硬币游戏制作(5) |
| 副标题: |
| 作者:佚名 文章来源:互联网 点击数:
更新时间:2005-9-23 10:16:40 |
|
| |
(22) 双击Script通道的第10帧,打开Script窗口,输入以下Lingo语句,如图8-88所示。
on exitFrame
go to the frame
end

图8-88 第10帧Lingo脚本
(23) 此时Score窗口的设置如图8-89所示。

图8-89 编排窗口的设置
(24) 在舞台上选中第1个硬币,单击右键,在快捷菜单中选择Script命令,打开Script窗口为其添加以下的Lingo语句,如图8-90所示。
global flag1
global mycount
global deletelist
on mouseUp
if flag1=0 then
if mycount>=3 then
exit
end if
sprite(2).visible=1
mycount=mycount+1
flag1=1
append (deletelist,2)
else
sprite(2).visible=0
flag1=0
mycount=mycount–1
repeat with x=1 to count(deletelist)
if getat(deletelist,x)=2 then
deleteat(deletelist,x)
end if
end repeat
end if
end mouseup

图8-90 第1个硬币的Lingo脚本
(25) 在舞台上选中第2个硬币,打开Script窗口为其添加以下的Lingo语句,如图8-91所示。
global flag2
global mycount
global deletelist
on mouseUp
if flag2=0 then
if mycount>=3 then
exit
end if
sprite(3).visible=1
mycount=mycount+1
flag2=1
append (deletelist,3)
else
sprite(3).visible=0
flag2=0
mycount=mycount–1
repeat with x=1 to count(deletelist)
if getat(deletelist,x)=3 then
deleteat(deletelist,x)
end if
end repeat
end if
end mouseup
(26) 对比这2个精灵脚本程序,它们是非常相似的。只不过第2个硬币的程序中将变量flag1换为flag2,而将所有涉及Sprite(2)的地方都换为Sprite(3)。以此类推将其他几个硬币的脚本程序设置好,在此就不详细列出了。

图8-91 第2个硬币的Lingo脚本
(27) 至此,“拿硬币游戏”制作完成了,播放效果如图8-92所示。

图8-92 “拿硬币游戏”播放效果
|
| 教程录入:潜龙在野 责任编辑:潜龙在野
|
|
上一篇教程: 拿硬币游戏制作(4)
下一篇教程: 决斗时刻游戏制作(1) |
| 【字体:小
大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】
|