home *** CD-ROM | disk | FTP | other *** search
- on createres
- global greslist, gspeed
- if gspeed < 4 then
- if count(greslist) = 0 then
- newresq()
- end if
- else
- set j to (gspeed / 2) + 1
- if j > 6 then
- set j to 5
- end if
- set i to random(j) - count(greslist)
- if i > 0 then
- repeat with ii = 1 to i
- newresq()
- end repeat
- end if
- end if
- end
-
- on moveres
- global greslist, grestmp
- set grestmp to []
- repeat with i = 1 to count(greslist)
- set res to getAt(greslist, i)
- if update(res) then
- add(grestmp, res)
- end if
- end repeat
- set greslist to []
- repeat with i = 1 to count(grestmp)
- set res to getAt(grestmp, i)
- add(greslist, res)
- end repeat
- end
-
- on checkres
- global greslist, gcursorh
- set k to 0
- repeat with i = 1 to count(greslist)
- set res to getAt(greslist, i)
- set ii to check(res, gcursorh)
- if ii = 1 then
- dspten()
- next repeat
- end if
- if ii = 2 then
- dspten()
- clear(1)
- set k to 1
- exit repeat
- next repeat
- end if
- if ii = -1 then
- dsplife(1)
- end if
- end repeat
- return k
- end
-
- on newresq
- newres(birth(script "ResQ"))
- end
-
- on newres res
- global greslist, gscoretop, gscoreend
- repeat with i = gscoretop to gscoreend
- if the puppet of sprite i = 0 then
- assignsprite(res, i)
- add(greslist, res)
- exit
- end if
- end repeat
- end
-