home *** CD-ROM | disk | FTP | other *** search
- global gBallDead, gScore, gLives, gEnemyCount2, gLevel, gWon, gBallSpriteNum
-
- on prepareMovie
- initGame()
- end
-
- on initGame
- sprite(11).blend = 100
- sprite(12).blend = 100
- sprite(13).blend = 100
- sprite(14).blend = 100
- sprite(150).visible = 0
- gLevel = 1
- gBallDead = 0
- gScore = 0
- put "0" into member "Score Display"
- gLives = 3
- put string(gLives) into member "Lives Display"
- put string(gLevel) into member "LevelDisplay"
- sound(1).volume = 64
- end
-
- on addScore points
- gScore = gScore + points
- updateScoreDisplay(gScore)
- end
-
- on updateScoreDisplay theScore
- put string(theScore) into member "Score Display"
- end
-
- on loseALife
- gLives = gLives - 1
- updateLivesDisplay(gLives)
- end
-
- on addALife
- gLives = gLives + 1
- updateLivesDisplay(gLives)
- end
-
- on updateLivesDisplay numLives
- put string(numLives) into member "Lives Display"
- end
-
- on getAngle loc1, loc2
- deltaX = loc2[1] - loc1[1]
- deltaY = -1 * (loc2[2] - loc1[2])
- if deltaY = 0 then
- if deltaX > 0 then
- return 0
- end if
- if deltaX < 0 then
- return 180
- end if
- end if
- if deltaX = 0 then
- deltaX = 0.01
- end if
- theAngle = atan(float(deltaY) / float(deltaX))
- theAngle = theAngle * 180 / PI
- if (deltaX < 0) and (deltaY > 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX < 0) and (deltaY < 0) then
- theAngle = 180 + theAngle
- else
- if (deltaX > 0) and (deltaY < 0) then
- theAngle = 360 + theAngle
- end if
- end if
- end if
- return theAngle
- end
-
- on waitAWhile me
- theTime10 = the ticks
- repeat while (theTime10 + 60) > the ticks
- nothing()
- end repeat
- end
-