home *** CD-ROM | disk | FTP | other *** search
- on mouseDown
- global shots
- set shots to shots - 1
- if shots >= 1 then
- puppetSound("gunshot.aif")
- updateStage()
- else
- puppetSound("clickup.aif")
- end if
- updateStage()
- end
-
- on enterFrame
- global wayV, speed, vertchange, ammo
- puppetSprite(1, 1)
- puppetSprite(2, 1)
- puppetSprite(3, 1)
- puppetSprite(4, 1)
- if the locH of sprite 2 > 450 then
- set the castNum of sprite 2 to 3
- set speed to random(10) + (10 * -1)
- set wayV to random(250)
- set vertchange to (wayV - the locV of sprite 2) / 20
- else
- if the locH of sprite 2 < -50 then
- set the castNum of sprite 2 to 1
- set speed to random(10) + 10
- set wayV to random(250)
- set vertchange to (wayV - the locV of sprite 2) / 20
- else
- if the locV of sprite 2 > 260 then
- set wayV to random(250)
- set vertchange to (wayV - the locV of sprite 2) / 20
- else
- if the locV of sprite 2 < 20 then
- set wayV to random(250)
- set vertchange to (wayV - the locV of sprite 2) / 20
- end if
- end if
- end if
- end if
- set the locV of sprite 2 to the locV of sprite 2 + vertchange
- set the locH of sprite 2 to the locH of sprite 2 + speed
- updateStage()
- set the locH of sprite 3 to the mouseH
- set the locV of sprite 3 to the mouseV
- set random to random(100)
- if random > 99 then
- set ammo to 1
- else
- if random < 3 then
- set ammo to 0
- end if
- end if
- if ammo = 1 then
- set the locV of sprite 4 to random(200) + 50
- set the locH of sprite 4 to random(350)
- set ammo to 2
- else
- if ammo = 0 then
- set the locH of sprite 4 to -100
- set the locV of sprite 4 to -100
- updateStage()
- end if
- end if
- end
-
- on exitFrame
- global shots, score
- set display to shots - 1
- set the text of cast "shots" to string(display)
- set the text of cast "score" to string(score)
- if shots <= 0 then
- go("gameover")
- else
- go("move")
- end if
- end
-