Game Development Reference
In-Depth Information
public function Main() {
init();
}
// init() is used to set up all of the things that
//we should only need to do one time
override public function init():void {
game = new SuperClick();
setApplicationBackGround(400, 400, false, 0x000000);
//add score board to the screen as the seconf layer
scoreBoard = new ScoreBoard();
addChild(scoreBoard);
scoreBoardTextFormat= new TextFormat("_sans", "11",
"0xffffff", "true");
scoreBoard.createTextElement(SCORE_BOARD_SCORE, new
SideBySideScoreElement (25, 5, 15, "Score",
scoreBoardTextFormat, 25, "0",scoreBoardTextFormat));
scoreBoard.createTextElement(SCORE_BOARD_CLICKED, new
SideBySideScoreElement(85, 5, 10, "Clicked",
scoreBoardTextFormat, 40, "0/0",scoreBoardTextFormat));
scoreBoard.createTextElement(SCORE_BOARD_PERCENT_NEEDED,
new SideBySideScoreElement(170,5, 10, "%Needed",
scoreBoardTextFormat, 50, "0%",scoreBoardTextFormat));
scoreBoard.createTextElement(SCORE_BOARD_PERCENT_ACHIEVED,
new SideBySideScoreElement(260, 5, 10, "%Achieved",
scoreBoardTextFormat, 60, "0%",scoreBoardTextFormat));
//screen text initializations
screenTextFormat = new TextFormat("_sans", "16",
"0xffffff", "false");
screenTextFormat.align = flash.text.TextFormatAlign.CENTER;
screenButtonFormat = new TextFormat("_sans", "12",
"0x000000", "false");
titleScreen = newBasicScreen(FrameWorkStates.
STATE_SYSTEM_TITLE, 400,400,false, 0x0000dd );
titleScreen.createOkButton("OK", new Point(170, 250),
40, 20, screenButtonFormat, 0x000000, 0xff0000,2);
titleScreen.createDisplayText("Super Click", 100,new
Point(145,150),screenTextFormat);
Search WWH ::




Custom Search