| 决斗时刻游戏制作(4) |
| 副标题: |
| 作者:佚名 文章来源:互联网 点击数:
更新时间:2005-9-25 10:25:41 |
|
| |
(31) 双击Script通道的第16帧,打开Script窗口,输入以下Lingo语句,如图8-121所示。
global which
global myticks
global life
global myscore
global level
on exitFrame
if the ticks-myticks>level then
set the visible of sprite 22 to 1
updatestage
set the visible of sprite 22 to 0
life=life-1
set the text of field "field2" to string(life)
if life<=0 then
-- alert "you loose"
go to "2"
exit
end if
myticks=the ticks
put life
end if
sprite(which).visible=1
go to the frame
end
on enterframe
if myscore>200 then
level=90
end if
if myscore>400 then
level=60
end if
if myscore>=600 then
go to "3"
end if
end
on mouseUp
puppetsound 2,"shoot1"
end mouseUp

图8-121 第16帧Lingo脚本
(32) 双击Script通道的第25帧和第35帧,打开Script窗口,输入以下Lingo语句,如图8-122所示。
on exitFrame me
go to the frame
end

图8-122 第25帧和第35帧Lingo脚本
(33) 为精灵1(封面)添加以下Lingo语句,如图8-123所示。
on mouseUp me
go to "0"
end

图8-123 精灵1的Lingo脚本
(34) 最后,编写以下电影脚本程序,对整个游戏程序进行初始化,如图8-124所示。
global life
global myscore
on startMovie
sprite(21).forecolor=255
life=5
myscore=0
sprite(22).visible=0
set the text of field "field2" to string(life)
set the text of field "field1" to string(myscore)
repeat with x=1 to 9
sprite(x+1).visible=0
end repeat
cursor 3
end startMovie

图8-124 电影脚本程序
(35) 至此,“决斗时刻游戏”制作完成,播放效果如图8-125所示。

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