home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 28
/
Creative-Review-CD-ROM-28.iso
/
pc
/
kungfu
/
assets
/
intro.dir
/
00124_Script_checkkey
< prev
next >
Wrap
Text File
|
1997-08-08
|
2KB
|
72 lines
on checkkey
global gmove , gkeylist, gkeyused, gpolllist, gjoylist, gpoll, gfunnykeys
set thekeylist = mgetallkeys ( gpoll )
-- put "in keyup", gmove, gkeylist, the key
repeat with letter in gkeyused
if ( letter = the key ) then
puppetsound "stun"
return false
end if
end repeat
case the key of
" " : set thepressed = getaprop ( gfunnykeys, #space )
tab : set thepressed = getaprop ( gfunnykeys, #tab )
return : set thepressed = getaprop ( gfunnykeys, #return )
backspace : set thepressed =getaprop ( gfunnykeys, #backspace )
enter : set thepressed = getaprop ( gfunnykeys, #enter )
otherwise: set thepressed = the key
end case
-- put "thepressed: " , thepressed
put thepressed into field "pressed key"
add gkeyused, the key
if getone ( gpolllist, gmove ) then
-- put "bg: " , gmove, thekeylist
if not ( count ( thekeylist )) then
puppetsound "stun"
put " " into field "pressed key"
return false
end if
set thecode = getat ( thekeylist , 1 )
setaprop gjoylist, gmove, thecode
else
set thecode = the keycode
setaprop gkeylist, gmove, thecode
end if
puppetsound "hit" & random ( 4 )
hold ( 1 * 60 )
put " " into field "pressed key"
return true
-- put "out keyup" , gkeylist
end checkkey
on hold ticks
starttimer
repeat while the timer < ticks
updatestage
end repeat
end hold