home *** CD-ROM | disk | FTP | other *** search
- on pongBallMove
- global giPongBallChannel, giPongPaddleChannel, giPongBrickChannel, giBallVH, giBallMaxVV, giBallMaxVH, giPaddleBounceAngle, giBallVV, giPongEasyMode, giPlayFieldLeftBoundary, giPlayFieldRightBoundary, giPlayFieldTopBoundary, giPlayFieldBottomBoundary, giPongScore, giBrickVOffset, giBrickHOffset, glWallChannels, glBrickList, giHideOffset, giPaddleHalfWidth, giPaddleQuarterWidth, giPongStraightThru, giBallMinTicks, giHitsOnDelay, glBallsInPlay, giPongSplashChannel
- set newLocH to the locH of sprite giPongBallChannel + giBallVH
- if (newLocH > giPlayFieldRightBoundary) or (newLocH < giPlayFieldLeftBoundary) then
- set giBallVH to -giBallVH
- set newLocH to newLocH + giBallVH + giBallVH
- puppetSound("WallPoing")
- end if
- set newLocV to the locV of sprite giPongBallChannel + giBallVV
- if newLocV < giPlayFieldTopBoundary then
- set giBallVV to -giBallVV
- puppetSound("WallPoing")
- set newLocV to newLocV + giBallVV + giBallVV
- if giBallMaxVV > giBallVV then
- set giBallVV to giBallVV + 1
- end if
- else
- if newLocV > giPlayFieldBottomBoundary then
- if giPongEasyMode = 0 then
- puppetSound("Sploosh")
- updateStage()
- set x to the timer
- repeat while the timer < (x + 60)
- nothing()
- end repeat
- pongNewBall()
- exit
- else
- set giBallVV to -giBallVV
- set newLocV to newLocV + giBallVV + giBallVV
- puppetSound("WallPoing")
- end if
- end if
- end if
- set the locH of sprite giPongBallChannel to newLocH
- set the locV of sprite giPongBallChannel to newLocV
- updateStage()
- repeat with count = 1 to count(glWallChannels)
- if sprite giPongBallChannel intersects getAt(glWallChannels, count) then
- set liColumnNumber to integer(((newLocH - giPlayFieldLeftBoundary) / giBrickHOffset) + 1)
- if liColumnNumber > 12 then
- set liColumnNumber to 12
- end if
- set llBrickRow to getAt(glBrickList, count)
- if getAt(llBrickRow, liColumnNumber) then
- if not giPongStraightThru then
- set giBallVV to -giBallVV
- set newLocV to newLocV + giBallVV + giBallVV
- end if
- set giPongScore to giPongScore + 60 - (10 * count)
- set liTempH to giPlayFieldLeftBoundary + ((liColumnNumber - 1) * giBrickHOffset) + 10
- set the locH of sprite giPongBrickChannel to liTempH
- set liTempV to giPlayFieldTopBoundary + ((count - 1) * giBrickVOffset) + 10
- set the locV of sprite giPongBrickChannel to liTempV
- updateStage()
- set the locV of sprite giPongBrickChannel to giHideOffset
- updateScore(count)
- setAt(llBrickRow, liColumnNumber, 0)
- end if
- end if
- end repeat
- if sprite giPongPaddleChannel intersects giPongBallChannel then
- set liPaddleLocH to the locH of sprite giPongPaddleChannel
- set liPongBallLocH to the locH of sprite giPongBallChannel
- if liPongBallLocH > (giPaddleQuarterWidth + liPaddleLocH) then
- if liPongBallLocH < (liPaddleLocH + giPaddleHalfWidth) then
- else
- set giBallVH to giBallVH + giPaddleBounceAngle
- end if
- else
- set giBallVH to giBallVH - giPaddleBounceAngle
- end if
- set newLocH to the locH of sprite giPongBallChannel + giBallVH
- set giBallVV to -giBallVV
- set newLocV to the locV of sprite giPongBallChannel + giBallVV
- set the locH of sprite giPongBallChannel to newLocH
- set the locV of sprite giPongBallChannel to newLocV
- soundPaddleHit()
- end if
- end
-