home *** CD-ROM | disk | FTP | other *** search
- property BangSprite, LastCallTime, BGSprite, NewBangPos, TurnTime, RunningDirection, RunningSpeed, IntersectedLast
-
- on birth me
- set BGSprite to 2
- set BangSprite to 5
- set LastCallTime to the ticks
- set NewBangPos to 0
- set TurnTime to the ticks + 60
- set RunningSpeed to 2
- set RunningDirection to 1
- puppetSprite(BangSprite, 1)
- return me
- end
-
- on RunBang me
- set StartLeft to the left of sprite BGSprite
- if (the ticks - LastCallTime) > 1 then
- if NewBangPos <= 100 then
- set RunningDirection to 1
- end if
- if NewBangPos >= 800 then
- set RunningDirection to -1
- end if
- if sprite 17 intersects BangSprite and not IntersectedLast then
- if RunningDirection = -1 then
- set NewDirection to 1
- end if
- if RunningDirection = 1 then
- set NewDirection to -1
- end if
- set RunningDirection to NewDirection
- Bounce()
- set TurnTime to the ticks + 60
- set RunningSpeed to 5
- set IntersectedLast to 1
- end if
- if the ticks > TurnTime then
- set NewRunDirection to random(2)
- if NewRunDirection = 1 then
- set RunningDirection to 1
- else
- set RunningDirection to -1
- end if
- set RunningSpeed to random(10)
- set TurnTime to the ticks + random(300)
- set IntersectedLast to 0
- end if
- if RunningDirection = 1 then
- set the memberNum of sprite BangSprite to 86
- end if
- if RunningDirection = -1 then
- set the memberNum of sprite BangSprite to 85
- end if
- set NewBangPos to (RunningDirection * RunningSpeed) + NewBangPos
- set LastCallTime to the ticks
- end if
- set the locH of sprite BangSprite to NewBangPos + StartLeft
- end
-