home *** CD-ROM | disk | FTP | other *** search
- property model, speed, psprite, pp, ph, pv, pb, pof1, pof2, pof3, phs, pend, phit
-
- on birth me
- global gspeed, gflg, gbarlist
- if gflg = 0 then
- if gspeed < 5 then
- set i to random(4)
- else
- set i to random(5)
- if i = 5 then
- set gflg to 1
- end if
- end if
- else
- set i to random(4)
- end if
- set model to integer(word i of "5 9 5 9 13")
- set pof1 to integer(word i of "-25 -25 -25 -25 -25")
- set pof2 to integer(word i of "61 70 61 70 10")
- set pof3 to integer(word i of "5 5 5 5 5")
- set phs to integer(word i of "42 24 42 24 34")
- set speed to integer(word random(gspeed + 1) of "5 10 12 15 17 3 22 25 27 5")
- set psprite to 0
- repeat while 1
- set ii to random(6)
- if getAt(gbarlist, ii) = 0 then
- setAt(gbarlist, ii, 1)
- set pp to ii
- exit repeat
- end if
- end repeat
- set ph to integer(word ii of "118 171 227 289 345 408")
- set pb to integer(word ii of "73 115 145 134 117 84")
- set pv to 0
- set pend to 0
- set phit to 0
- return me
- end
-
- on assignsprite me, aSprite
- set psprite to aSprite
- set the puppet of sprite psprite to 1
- set the type of sprite psprite to 1
- set the ink of sprite psprite to 8
- set the castNum of sprite psprite to model
- set the locV of sprite psprite to pv
- set the locH of sprite psprite to ph + pof1
- end
-
- on move me
- global gspeed, gbarlist
- if pend = 0 then
- set i to the bottom of sprite psprite
- if i < 280 then
- if the locV of sprite psprite > pb then
- set the castNum of sprite psprite to model + 1
- set j to integer(word gspeed + 1 of "20 20 20 20 20 20 20 20 20 20")
- set the locV of sprite psprite to the locV of sprite psprite + j
- puppetSound("FALL2")
- if i > 280 then
- set the locV of sprite psprite to the locV of sprite psprite - (i - 280)
- else
- if phit = 0 then
- if (i + 20) > 253 then
- set the locV of sprite psprite to the locV of sprite psprite - (i - 233)
- set phit to 1
- end if
- end if
- end if
- else
- if speed >= 0 then
- set speed to integer(word random(gspeed + 2) of "17 5 10 12 15 17 0 0 20 0 0")
- set the locV of sprite psprite to the locV of sprite psprite + speed
- if speed = 0 then
- set speed to -random(gspeed * 7)
- end if
- else
- set speed to speed + 1
- end if
- end if
- else
- set the castNum of sprite psprite to model + 3
- set i to the bottom of sprite psprite - 280
- set the locV of sprite psprite to the locV of sprite psprite - i
- set phit to -1
- set pend to the ticks + 120
- puppetSound("OUT")
- end if
- else
- if pend < the ticks then
- set the puppet of sprite psprite to 0
- setAt(gbarlist, pp, 0)
- return 0
- end if
- end if
- return 1
- end
-
- on atari me, ch
- global gbarlist
- if pend = 0 then
- if phit = 1 then
- set phit to 2
- set i to the left of sprite psprite + phs
- if i > (ch - 40) then
- if i < (ch + 40) then
- set model to model + 2
- set the castNum of sprite psprite to model
- set i to the bottom of sprite psprite - 253
- set the locV of sprite psprite to the locV of sprite psprite - i
- set pend to the ticks + 20
- puppetSound("OK")
- setAt(gbarlist, pp, 0)
- if model = the number of cast "Baba-safe" then
- return 2
- else
- return 1
- end if
- end if
- end if
- end if
- end if
- if phit = -1 then
- set phit to 0
- return -1
- else
- return 0
- end if
- end
-
- on update me
- return move(me)
- end
-
- on check me, ch
- return atari(me, ch)
- end
-