home *** CD-ROM | disk | FTP | other *** search
- property speed, x, y, howoften, chanel, break, delay, castnumber, point, shake, type
-
- on birth me, v_speed, v_x, v_y, v_howoften, v_chanel, v_break, v_delay, v_castnumber, v_point, v_shake, v_type
- set speed to v_speed
- set x to v_x
- set y to v_y
- set howoften to v_howoften
- set chanel to v_chanel
- set break to v_break
- set delay to v_delay
- set castnumber to v_castnumber
- set point to v_point
- set shake to v_shake
- set type to v_type
- puppetSprite(chanel, 1)
- set the locH of sprite chanel to x
- set the locV of sprite chanel to y
- return me
- end
-
- on takeabreak
- if random(howoften) = 1 then
- set break to 50
- else
- set break to 0
- end if
- end
-
- on sethitmarkposition
- global hitmark
- set the locV of sprite hitmark to mouseV()
- set the locH of sprite hitmark to mouseH()
- end
-
- on resethitmarkposition
- global hitmark
- set the locV of sprite hitmark to 0
- set the locH of sprite hitmark to 500
- end
-
- on hit
- global score, defy
- if shake = 0 then
- puppetSound("hit")
- set the castNum of sprite chanel to castnumber + 1
- set delay to 4
- set score to score + point
- set the text of cast "score feild" to string(score)
- else
- puppetSound("hit")
- set the castNum of sprite chanel to castnumber + 1
- set delay to 8
- set score to score + (point * -1)
- set the text of cast "score feild" to string(score)
- end if
- sethitmarkposition()
- end
-
- on hitufo
- global score, ufo
- sethitmarkposition()
- puppetSound("hit")
- set score to score + 50
- set the text of cast "score feild" to string(score)
- set the locH of sprite ufo to -20
- set the locV of sprite ufo to 150 - (random(60) / 2)
- end
-
- on moveufo
- global n, ufoh, ufo
- if the locH of sprite ufo < 0 then
- if random(10) = 1 then
- set ufoh to 420
- else
- set ufoh to 1000
- end if
- set the locH of sprite ufo to ufoh
- set the locV of sprite ufo to 150 - (random(60) / 2)
- else
- set the locH of sprite ufo to the locH of sprite ufo - 12
- set the locV of sprite ufo to the locV of sprite ufo + (sin(n) * 10 / 2)
- set n to n + 1
- end if
- end
-
- on stepFrame me
- global defy, defspace, counter, defmargin, defscreenwidth
- if break = 0 then
- if shake = 0 then
- set y to y + speed
- end if
- if y > 170 then
- if shake = 0 then
- if random(1) = 1 then
- set shake to 10
- else
- set y to defy + random(50)
- set x to random(defscreenwidth) + defmargin
- set x to alignx(x)
- end if
- else
- if type = "stable" then
- set shake to shake - 1
- else
- if (shake mod 2) = 0 then
- set x to x + 4
- else
- set x to x - 4
- end if
- set shake to shake - 1
- end if
- if shake = 0 then
- set y to defy + random(50)
- set x to random(defscreenwidth) + defmargin
- set x to alignx(x)
- end if
- end if
- end if
- else
- set break to break - 1
- if break = 0 then
- set the locV of sprite chanel to defy
- set x to random(defscreenwidth) + defmargin
- set x to alignx(x)
- set the castNum of sprite chanel to castnumber
- end if
- end if
- if delay <> 0 then
- set delay to delay - 1
- if delay = 0 then
- set the locV of sprite chanel to defy
- set x to random(defscreenwidth) + defmargin
- set the castNum of sprite chanel to castnumber
- resethitmarkposition()
- end if
- else
- set the locV of sprite chanel to y
- set the locH of sprite chanel to x
- end if
- end
-
- on alignx x
- if x < 30 then
- set x to 30
- end if
- if x > 370 then
- set x to 370
- end if
- return x
- end
-