home *** CD-ROM | disk | FTP | other *** search
- global starfieldSO, maxStars, starDepth, starfieldData, playerViewPoint
-
- on initializeStarField
- starfieldData = []
- repeat with wStar = 1 to maxStars
- wSprite = starfieldSO + wStar
- puppetSprite(wSprite, 1)
- rDepth = random(40)
- set the loc of sprite wSprite to point(random(580), random(440))
- set the member of sprite wSprite to "star " & string(6 - (rDepth / 8))
- set the ink of sprite wSprite to 33
- sprite(wSprite).locZ = starDepth
- add(starfieldData, [point(random(10000), random(10000)), rDepth])
- end repeat
- end
-
- on runStarField
- repeat with wStar = 1 to count(starfieldData)
- starloc = starfieldData[wStar][1] - (playerViewPoint * starfieldData[wStar][2] / 1000)
- starloc[1] = starloc[1] mod 580
- starloc[2] = starloc[2] mod 440
- wSprite = starfieldSO + wStar
- set the loc of sprite wSprite to starloc
- end repeat
- end
-