• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Parent/Child Project: An arcade-style game > Scripting initial tasks

Scripting initial tasks

As usual, most of the necessary variables and functions are established in the on startMovie handler. In it, the initial values for the key global variables are set, and the text fields pertaining to score display are set to zero or cleared.

-- the number of high scores to save in the high-score list
gMaxHighGScores = 12
-- vertical speed of the missile (pixels per each move)
gMissileSpeed = 15
-- the speed of the battlestation moving right or left
gBattleSpeed = 5
-- the number of aliens (12 maximum)
gMaxAliens = 8
-- (1–5 missiles) the more missiles, the easier the game is
gMaxMissiles = 2
-- the battlestation sprite's channel number
gBstationSprite = 48
-- high game score
gHighGScore = 0
-- initial speed of the aliens
gInitGSpeed = 1
-- amount Speed is increased for the aliens
gIncSpeed = 0.2
-- clear any previous missiles or aliens
the actorList = [ ]
-- initial direction for the battle station; possible
-- values are #still, #left, and #right
gkeyDirection = #still
-- initialize the missile's list
gMissileList = [ ]
-- Initialize the alien's list
gAlienList = [ ]
member("HighScore").text = "0"
member("Score").text = "0"
member("HighScoreList").text = " "


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint