# ScriptDoc Reference

## Properties

### static null game.mainAssistant

A reference to the main scene assistant.

### static null game.mainAssistant

A reference to the main scene assistant.

### static Boolean game.gameInProgress

Flag set to true when a game is in progress (used for pausing).

### static Boolean game.gameInProgress

Flag set to true when a game is in progress (used for pausing).

### static null game.ctx

The 2D context of the canvas.

### static null game.screenHeight

The height of the screen. Used throughout to deal with 400 versus 480 screen heights.

### static null game.mainLoopBind

This is a reference to the main game loop bound to the context of the game object. This is necessary to provide the proper execution context when the main game loop is executed form the interval.

### static null game.keyDownBind

Binds for the key, screen, orientation change and stage event handlers.

### static null game.keyDownBind

Binds for the key, screen, orientation change and stage event handlers.

### static null game.keyDownBind

Binds for the key, screen, orientation change and stage event handlers.

### static null game.mainLoopInterval

Reference to the interval that runs the main game loop.

### static Number game.xAdj

X/Y values to adjust all coordinates so things are drawn in the playfield.

### static Number game.xAdj

X/Y values to adjust all coordinates so things are drawn in the playfield.

### static Number game.xOrigin

x/y values to adjust with Canvas operation "Rotate(90)" which creates needs to translate origins of screen width ( 320 )

### static Number game.xOrigin

x/y values to adjust with Canvas operation "Rotate(90)" which creates needs to translate origins of screen width ( 320 )

### static Number game.xOrigin

x/y values to adjust with Canvas operation "Rotate(90)" which creates needs to translate origins of screen width ( 320 )

### static null game.background

The game background image and its height.

### static null game.background

The game background image and its height.

### static null game.ingredient.ingredient

The ingredient descriptor object.

### static Array game.ingredient.ingredient

The ingredient descriptor object.

### static null game.boardIngredients.boardIngredients

Object containing all data of ingredients on the board

### static Number game.boardIngredients.boardIngredients

Object containing all data of ingredients on the board

### static null game.recipeIngredients.recipeIngredients

Object containing all data of ingredients for the recipe TYPE is for pattern recognition

### static Number game.recipeIngredients.recipeIngredients

Object containing all data of ingredients for the recipe TYPE is for pattern recognition

### static Number game.scoring.scoring

Scoring interface

### static null game.scoring.scoring

Scoring interface

### static null game.timer.timer

Timer interface

### static null game.timer.timer

Timer interface

### static null game.theme.theme

Theme container that contains the current graphical theme

### static Number game.gameConsole.gameConsole

An object to hold everything relating to the console and hands.

### static null game.dialog

Reference to the currently opened dialog, if any.

### static null game.dialog

Reference to the currently opened dialog, if any.

### static null game.dialog

Reference to the currently opened dialog, if any.

### static Boolean game.checkStacks.checkStacks

checkStacks : Check all the stack to see if one stack has a destroyed element

### static Object game.checkOneStack.checkOneStack

checkOneStack : Check a column of the board to see if an element is destroyed i : place of the destroyed element

## Functions

### game.init() : static

************************************************************************ BEGIN Initialize the game. This is called once at application startup.*

### game.startNewGame() : static

***************************************************************** BEGIN Start a new game. Called any time the game is restarted. *

### game.firstDraw() : static

firstDraw : check the board for before the game start so there is no an alignement of 3 or more ingredient already

### game.mainLoop() : static

*************************************************************** BEGIN The main game loop. All of the good stuff happens here!*

### game.vibrate() : static

*************** END mainLoop *

### game.drawHands() : static

Draws the hands in their current position.

### game.drawBoard() : static

Draws the ingredients on the board

### game.keyDown(Object inEvent) : static

Handle KeyDown events.

Object | inEvent | The generated event object.

### game.dragStartHandler(Object inEvent) : static

Handle dragStart events.

Object | inEvent | The generated event object.

### game.draggingHandler(Object inEvent) : static

Handle dragging events.

Object | inEvent | The generated event object.

### game.dragEndHandler(Object inEvent) : static

Handle dragStart events.

Object | inEvent | The generated event object.

### game.keyUp() : static

Handle KeyUp events.

### game.tapHandler(Object inEvent) : static

***************************************************** Handle screen tap events. * *

Object | inEvent | The generated event object. *

### game.orientationChange() : static

Handles orientation change events.

### game.stageActivate() : static

Handles stage activation event.

### game.stageDeactivate() : static

Handles stage deactivation event.

### game.newIngredient() : static

Generates new ingredient and insert it in the board good

### game.swapIngredients() : static

swapIngredients : Allow to exchange ingredients places

### game.addTextToQueue() : static

addTextToQueue : To display a text on the screen witch will disapear after a few seconds

### game.addAnimToQueue() : static

** NEMBLETON - LAST 2010.04.13

### game.stackDecreased() : static

stackDecreased : decrease the stack animation when it's done

### game.checkBoundx() : static

checkBoundx : checks if next move is within tolerated array bounds

### game.checkBoundy() : static

checkBoundy : checks if next move is within tolerated array bounds

### game.checkFullBoard() : static

checkFullBoard :check full board to see if there is another combo

### game.checkStacks() : static

checkStacks : Check all the stack to see if one stack has a destroyed element

### game.checkOneStack() : static

checkOneStack : Check a column of the board to see if an element is destroyed i : place of the destroyed element

### game.checkBoardForPatterns() : static

checkBoardForPatterns : Checks from moved elements if we have some kind of pattern and/or combo

### game.escalatePattern() : static

escalatePattern : recursively escalate patterns right, left, top, right Return true if there is a double combo

### game.ingredientType() : static

ingredientType : Returns the type of the ingredients to ease code reading

### game.xyToPos() : static

xyToPos

### game.posToX() : static

posToX

### game.posToY() : static

posToY

### game.addItemToDestroy() : static

addItemToDestroy : Adds one more item in the combo list

### game.resetQtyPerType() : static

resetQtyPerType: Reset qty per type before pattern checking MAX_ING_FIX : To add more ingredients

### game.openDBSuccess() : static

openDBOK: open database successful If openDB ok ==> open challengeMenu If challengeMenu OK ==> Load the contents in livreChallenge If challengeMenu NOK ==> Load a default value in livreChallenge

### game.openDBFailure() : static

openDBFailure: open database failure

### game.ecran_choix() : static

ecran_choix : allow to choose the menu.

### game.levelUp() : static

levelUp : increments the currentLevel and the next-step Re-initialize the timer according to the current level : Player will have less and less time if he has a high level Check level and add new ingredients

### game.generateNewRecipe() : static

generateNewRecipe : Generate a new recipe when the previous is finished Reinitialize the this.gameConsole.ingredientObtenu

### game.addMoreIngredientRequis() : static

addMoreIngredientRequis : increments the number of request ingredient each 5 level

### game.drawRecipe() : static

drawRecipe : draw the current recipe on the notebook

### game.incrementQtyObtenu() : static

incrementsQtyObtenu

### game.showRecipe() : static

showRecipe : check the current recipe on the notebook

### game.showScore() : static

showScore : show the score on the top-left corner It's just drawing

### game.gameOver() : static

gameOver : End of the game Return to page menu or begin a new game

### game.setPause() : static

setPause : Show pause mode

### game.setHighScore() : static

setHighScore : Choose between online highscore and local highscore

### game.setHighScoreOnline() : static

setHighScoreOnline : To enter the name of the player in online

### game.setHighScoreLocal() : static

setHighScoreOnline : To enter the name of the player in online

### game.setHighScoreOnlineAndLocal() : static

setHighScoreOnlineAndLocal : To enter the name of the player in online an local

### game.setPopUpPbServer() : static

setPopUpPbServer : Display a message in popup so user know server don't work