home *** CD-ROM | disk | FTP | other *** search
- property iiVH, iiVV, iiMaxVH, iiMaxVV, iiChannel, iiCastName
-
- on birth me, piVH, piVV, piMaxVH, piMaxVV, piChannel, psCastName
- set the iiVH of me to piVH
- set the iiVV of me to piVV
- set the iiMaxVH of me to piMaxVH
- set the iiMaxVV of me to piMaxVV
- set the iiChannel of me to piChannel
- set the iiCastName of me to psCastName
- puppetSprite(the iiChannel of me, 1)
- if the depth of cast psCastName = 1 then
- set the foreColor of sprite the iiChannel of me to 5
- end if
- set the castNum of sprite the iiChannel of me to the number of member psCastName
- set the locH of sprite the iiChannel of me to 320
- set the locV of sprite the iiChannel of me to 140
- if the visible of sprite the iiChannel of me = 0 then
- set the visible of sprite the iiChannel of me to 1
- end if
- debugMessage("birthed")
- return me
- end
-
- on mPongBallReset me
- set the locH of sprite the iiChannel of me to integer((the stageRight - the stageLeft) / 2)
- set the locV of sprite the iiChannel of me to 80
- set the iiVV of me to integer(the iiVV of me / 2)
- if (the iiVV of me < 5) and (the iiVV of me > -5) then
- set the iiVV of me to 5
- end if
- end
-
- on mPongBallMove me
- global giPongPaddleChannel, giPongBrickChannel, giPaddleBounceAngle, giPongEasyMode, giPlayFieldLeftBoundary, giPlayFieldRightBoundary, giPlayFieldTopBoundary, giPlayFieldBottomBoundary, giPongScore, giBrickVOffset, giBrickHOffset, glWallChannels, glBrickList, giHideOffset, giPaddleHalfWidth, giPaddleQuarterWidth, giPongStraightThru, giBallMinTicks, giHitsOnDelay, giPongSplashChannel, gbPaused
- set liStartingTicks to the ticks
- set tempChannel to the iiChannel of me
- set newLocH to the locH of sprite tempChannel + the iiVH of me
- if (newLocH > giPlayFieldRightBoundary) or (newLocH < giPlayFieldLeftBoundary) then
- set the iiVH of me to -(the iiVH of me)
- set newLocH to newLocH + the iiVH of me + the iiVH of me
- puppetSound("WallPoing")
- end if
- set newLocV to the locV of sprite the iiChannel of me + the iiVV of me
- if newLocV < giPlayFieldTopBoundary then
- set the iiVV of me to -(the iiVV of me)
- puppetSound("WallPoing")
- set newLocV to newLocV + the iiVV of me + the iiVV of me
- if the iiMaxVV of me > the iiVV of me then
- set the iiVV of me to the iiVV of me + 1
- end if
- else
- if newLocV > giPlayFieldBottomBoundary then
- if giPongEasyMode = 0 then
- puppetSound("Sploosh")
- set the locH of sprite giPongSplashChannel to newLocH
- updateStage()
- set x to the timer
- repeat while the timer < (x + 60)
- nothing()
- end repeat
- pongNewBall()
- if gbPaused = 0 then
- mPongBallReset(me)
- end if
- exit
- else
- set the iiVV of me to -(the iiVV of me)
- set newLocV to newLocV + the iiVV of me + the iiVV of me
- puppetSound("WallPoing")
- end if
- end if
- end if
- set the locH of sprite the iiChannel of me to newLocH
- set the locV of sprite the iiChannel of me to newLocV
- updateStage()
- set lTemp to pongCheckForHit(the iiChannel of me)
- if listp(lTemp) then
- pongProcessHit(lTemp)
- if not giPongStraightThru then
- set the iiVV of me to -(the iiVV of me)
- set newLocV to newLocV + the iiVV of me + the iiVV of me
- end if
- end if
- if sprite giPongPaddleChannel intersects the iiChannel of me then
- set liPaddleLocH to the locH of sprite giPongPaddleChannel
- set liPongBallLocH to the locH of sprite the iiChannel of me
- if liPongBallLocH > (giPaddleQuarterWidth + liPaddleLocH) then
- if liPongBallLocH < (liPaddleLocH + giPaddleHalfWidth) then
- else
- set the iiVH of me to the iiVH of me + giPaddleBounceAngle
- end if
- else
- set the iiVH of me to the iiVH of me - giPaddleBounceAngle
- end if
- if abs(the iiVH of me) > the iiMaxVH of me then
- if the iiVH of me < 0 then
- set the iiVH of me to -(the iiMaxVH of me)
- else
- set the iiVH of me to the iiMaxVH of me
- end if
- end if
- set newLocH to the locH of sprite the iiChannel of me + the iiVH of me
- set the iiVV of me to -(the iiVV of me)
- set newLocV to the locV of sprite the iiChannel of me + the iiVV of me
- set the locH of sprite the iiChannel of me to newLocH
- set the locV of sprite the iiChannel of me to newLocV
- soundPaddleHit()
- end if
- repeat while the ticks < (liStartingTicks + giBallMinTicks)
- set giHitsOnDelay to giHitsOnDelay + 1
- pongPaddleMove()
- end repeat
- end
-