home *** CD-ROM | disk | FTP | other *** search
- property baloneypos, baloneyinc, baloneydest, chan, doing, castset, facing, oldfacing, nextdecision, myhead, animstep, nextanim, walkanim, hitAnim, animdoing, reacting, mylasthit
- global animlist
-
- on new me, mychan, Twalkanim, Thitanim
- set chan to mychan
- puppetSprite(chan, 1)
- set baloneypos to point(-100, -100)
- set baloneyinc to point(0, 0)
- set doing to 0
- set castset to []
- set animstep to 1
- set nextanim to 1
- set walkanim to getaProp(animlist, Twalkanim)
- set hitAnim to getaProp(animlist, Thitanim)
- set animdoing to walkanim
- set reacting to 0
- return me
- end
-
- on GetLocation me
- return baloneypos
- end
-
- on Pickup me
- return doing
- end
-
- on foreplay me, initstring
- global KBaloneyChan, KBirdyChan
- set castset to the number of member "baloneyset"
- set baloneyinc to point(0, 0)
- case chan of
- KBirdyChan, (KBirdyChan + 1):
- set baloneypos to point(520, 40)
- set baloneyinc to point(10, 0)
- KBaloneyChan:
- set baloneypos to point(520, 480)
- end case
- set doing to 1
- set nextdecision to the timer + 60
- set myhead to 0
- set facing to -1
- set oldfacing to -1
- set mylasthit to 0
- end
-
- on dork me, sourceObj, dorktype
- global KBaloneyChan, KBirdyChan, PowerupRef, score, baloneyhits, baloneysndHits
- case chan of
- KBirdyChan, (KBirdyChan + 1):
- addscore(100, baloneypos)
- set the anvilinc of sourceObj to point(0, 2) + (the anvilinc of sourceObj * point(1, -1)) + point(random(5) - 3, random(5 - 3))
- soundplay(SndHitBirdy)
- set animdoing to hitAnim
- KBaloneyChan:
- case dorktype of
- 0:
- case PowerupRef of
- 4:
- addscore(300, baloneypos)
- set animdoing to getAt(baloneyhits, 3)
- soundplay(getAt(baloneysndHits, 3))
- PowerDown(-1)
- 5:
- addscore(500, baloneypos)
- set animdoing to getAt(baloneyhits, 1)
- soundplay(getAt(baloneysndHits, 1))
- PowerDown(-1)
- 6:
- addscore(300, baloneypos)
- set animdoing to getAt(baloneyhits, 4)
- soundplay(getAt(baloneysndHits, 4))
- PowerDown(-1)
- otherwise:
- capture(sourceObj, baloneypos)
- set animdoing to hitAnim
- end case
- 3:
- repeat with xxx = 1 to 5
- addscore(11, baloneypos)
- end repeat
- if PowerupRef = 5 then
- addscore(500, baloneypos)
- set animdoing to getAt(baloneyhits, 1)
- soundplay(getAt(baloneysndHits, 1))
- PowerDown(-1)
- else
- addscore(300, baloneypos)
- set animdoing to getAt(baloneyhits, 2)
- soundplay(getAt(baloneysndHits, 2) - 1 + random(8))
- end if
- end case
- end case
- set reacting to 1
- set mylasthit to 0
- set animstep to 0
- set oldfacing to 0
- set nextdecision to the timer + 360
- end
-
- on love me, forceupdate
- global anviltime, anvilcount, baloneyspeed, playerobj, KBaloneyChan, KBirdyChan, PowerupRef
- if forceupdate then
- set the loc of sprite chan to baloneypos
- if animstep < 1 then
- set animstep to 1
- end if
- set the memberNum of sprite chan to getAt(animdoing, animstep)
- exit
- end if
- if PowerupRef = 5 then
- exit
- end if
- if doing > 0 then
- case chan of
- KBirdyChan, (KBirdyChan + 1):
- if not reacting then
- if mylasthit < 300 then
- set mylasthit to mylasthit + 1
- end if
- set baloneypos to baloneypos + baloneyinc
- if the locH of baloneypos > 700 then
- set the locH of baloneypos to -40
- set the locV of baloneypos to 25 + (random(4) * 30)
- else
- if random(301 - mylasthit) = 1 then
- addblock(baloneypos)
- end if
- end if
- set the loc of sprite chan to baloneypos
- end if
- KBaloneyChan:
- if not reacting then
- set baloneyinc to baloneyspeed * point(sgn(the locH of sprite 100 - the locH of baloneypos), 0)
- set baloneypos to baloneypos + baloneyinc
- set the loc of sprite chan to baloneypos
- end if
- end case
- if the timer > nextanim then
- set nextanim to the timer + 6
- set animstep to animstep + 1
- if animstep > count(animdoing) then
- if reacting > 0 then
- set reacting to 0
- if chan = KBaloneyChan then
- release(playerobj, baloneypos + point(0, -100))
- end if
- set animdoing to walkanim
- end if
- set animstep to 1
- end if
- if getAt(animdoing, animstep) > 10000 then
- set animstep to animstep + 1
- end if
- set the memberNum of sprite chan to getAt(animdoing, animstep)
- set the loc of sprite chan to baloneypos
- end if
- end if
- end
-
- on climax me
- set doing to 0
- set the loc of sprite chan to point(-100, -100)
- end
-