本文由课件大师网站收集、整理或撰写,转载请署原作者名,并请注明出处,谢谢合作!
(11) 下面为每一个敌人精灵添加精灵脚本,选中左上角窗口的敌人精灵,单击右键,在快捷菜单中选择Script命令,打开Script窗口为其添加以下的Lingo语句,如图8-103所示。
global myscore
on mouseUp
puppetsound 2,"shoot1"
set the member of sprite 2 to "dead"
updatestage
mytick=the ticks
repeat while 1
if the ticks-mytick>15 then
exit repeat
end if
end repeat
sprite(2).visible=0
set the member of sprite 2 to "enemy"
myscore=myscore+10
set the text of field "field1" to string(myscore)
go to "1"
end

图8-103 第1个敌人精灵脚本
(12) 选中左上角窗口的第2个敌人精灵,打开Script窗口为其添加以下的Lingo语句,如图8-104所示。
global myscore
on mouseUp
puppetsound 2,"shoot1"
set the member of sprite 3 to "dead"
updatestage
mytick=the ticks
repeat while 1
if the ticks-mytick>15 then
exit repeat
end if
end repeat
sprite(3).visible=0
set the member of sprite 3 to "enemy"
myscore=myscore+10
set the text of field "field1" to string(myscore)
go to "1"
end

图8-104 精灵脚本
(13) 对比这两个精灵脚本程序,它们是非常相似的。只不过将所有涉及精灵2的地方都换为精灵3。以此类推将其他几个精灵的脚本程序设置好,在此就不详细列出了。
(14) 按Ctrl+6组合键,弹出Text窗口,设置字体和大小,输入文本“得分:”,如图8-105所示。

图8-105 输入文本“得分:”
(15) 单击窗口左上角的“+”按钮,创建新的窗口,输入文本“生命:”,如图8-106所示。

图8-106 输入文本“生命”
(16) 单击窗口左上角的“+”按钮,创建新的窗口,设置字体和大小,输入文本“简单”,如图8-107所示。

图8-107 输入文本“简单”
(17) 单击Cast Member Script按钮,输入以下Lingo语句,如图8-108所示。
global level
on mouseUp
level=120
go to "1"
end
on mouseEnter
sprite(19).forecolor=0
end mouseEnter
on mouseleave
sprite(19).forecolor=255
end mouseleave

图8-108 文本“简单”的脚本程序
(18) 创建新的窗口,设置字体和大小,输入文本“一般”。单击Cast Member Script按钮,输入以下Lingo语句,如图8-109所示。
global level
on mouseUp
level=90
go to "1"
end
on mouseEnter
sprite(20).forecolor=0
end mouseEnter
on mouseleave
sprite(20).forecolor=255
end mouseleave

图8-109 文本“一般”的脚本程序
(19) 创建新的窗口,设置字体和大小,输入文本“高难”。单击Cast Member Script按钮,输入以下Lingo语句,如图8-110所示。
global level
on mouseUp
level=60
go to "1"
end
on mouseEnter
sprite(21).forecolor=0
end mouseEnter
on mouseleave
sprite(21).forecolor=255
end mouseleave

图8-110 文本“高难”的脚本程序
|