HTML and CSS Reference
In-Depth Information
}
}
function gameStateWaitForLoad(){
//do nothing while loading events occur
//console.log("doing nothing...")
}
function gameStateInit() {
tileSheet = new Image();
tileSheet.src = "tanks_sheet.png";
tileSheet.onload = itemLoaded;
switchGameState(GAME_STATE_WAIT_FOR_LOAD);
}
function itemLoaded(event) {
loadCount++;
////console.log("loading:" + loadCount)
if (loadCount >= itemsToLoad) {
switchGameState(GAME_STATE_TITLE)
}
}
function gameStateTitle() {
if (screenStarted !=true){
fillBackground();
setTextStyleTitle();
context.fillText ("Micro Tank Maze", 160, 70);
context.fillText ("Press Space To Play", 150, 140);
screenStarted = true;
}else{
//wait for space key click
if (keyPressList[32]==true){
//console.log("space pressed");
switchGameState(GAME_STATE_NEW_GAME);
screenStarted = false;
}
}
}
function gameStatePlayerWin(){
if (!screenStarted){
Search WWH ::




Custom Search