home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jommeke
/
Jommeke.iso
/
movies
/
spotdiff.dir
/
00054_Script_54
< prev
next >
Wrap
Text File
|
2000-02-23
|
4KB
|
195 lines
on checkmatch
global leftchoice,rightchoice,diffstore,score,found,lasthitticks
set matched to false
-- put "leftchoice"&&leftchoice&&"rightchoice"&&rightchoice
repeat with n=1 to 5
put getat(diffstore,n) into tempdiff
if tempdiff=leftchoice then
timebonus
calcscore
-- updatescore
-- put the timer into lasthitticks
put found+1 into found
setat diffstore,n,99
set matched to true
correctanim
end if
end repeat
if matched=false then
timefine
wronganim
end if
checkwinorlose
end
on updatescore
global score
put score into field "score"
end
on calcscore
global score,lasthitticks
put the timer into nowticks
put nowticks-lasthitticks into elapticks
--now give a bonus according to how few ticks since the last hit
--60 ticks per second
--1 second gives 60 ticks = 600 points
--10 seconds gives 600 ticks gives 10 points
--score is 600-elapticks
set scorebonus=600-elapticks
if scorebonus<10 then set scorebonus=10
if elapticks<60 then set scorebonus=1000
set score=score+scorebonus
set lasthitticks=nowticks
updatescore
end
on checkwinorlose
global found,SECS
if found=5 then
win
exit
end if
end
on win
-- hidesprites
showlevelpic
puppetsound 1,"levwin"
go to frame "win"
levelbonusanim
checkfornewhiscore
end
on levelbonusanim
global barch,score,sexpics,secs
wait(60)
put the right of sprite barch into barxstart
puppetsound 2,"bonus"
set bonus=0
repeat with n=1 to barxstart/4
set bonus=bonus+12
set score=score+12
updatescore
put bonus into field "bonusscore"
put the loch of sprite barch into barx
set the loch of sprite barch to barx-4
updatestage
-- wait(1)
end repeat
puppetsound 2,0
puppetsound 2,"addscore"
end
on wait ticks
put the timer into t
repeat while the timer<(t+ticks)
end repeat
end
on lose
hidesprites
showlevelpic
puppetsound 1,"lose"
go to frame "lose"
-- checkfornewhiscore
end
on correctanim
global leftchoice,rightchoice,leftpic,markerch,rightspritech,leftspritech,posdata,frame
set the visible of sprite markerch to false
set the visible of sprite markerch+1 to false
put getat(posdata,frame) into levdata
put getat(levdata,leftchoice) into lpair
put getat(lpair,1) into x1
put getat(lpair,2) into y1
--draw tick on left
put leftspritech+leftchoice-1 into sch
set the member of sprite sch =member 38 of castlib 1
set the loch of sprite sch to x1
set the locv of sprite sch to y1
--draw tick on right
put rightspritech+leftchoice-1 into sch
set the member of sprite sch =member 38 of castlib 1
set the loch of sprite sch to x1+395
set the locv of sprite sch to y1+85
set the visible of sprite sch to true
puppetsound 1,"right"
waitforsound
end
on wronganim
global leftchoice,rightchoice,diffchbase,markerch
set the member of sprite markerch to member "cross"
set the member of sprite markerch+1 to member "cross"
puppetsound 1,"wrong"
waitforsound
set the visible of sprite markerch to false
set the visible of sprite markerch+1 to false
set the member of sprite markerch to member "leftmarker"
set the member of sprite markerch+1 to member "rightmarker"
end
on waitforsound
updatestage
repeat while soundbusy(1) or soundbusy(2)
end repeat
end
on anyleftclick
global mx,my,posdata,leftspritech,posdata,level,leftchoice,activepic,markerch
put the clickLoc into mousepoint
put the loch of mousepoint into mx
put the locv of mousepoint into my
put the clickon-leftspritech+1 into leftchoice
-- put "leftchoice",leftchoice
puppetsound 1,"leftclick"
set the loc of sprite markerch to mousepoint
set the visible of sprite markerch to true
waitforsound
checkmatch
end