HTML and CSS Reference
In-Depth Information
}
function canvasApp(){
if (!canvasSupport()) {
return;
}else{
theCanvas = document.getElementById("canvas");
context = theCanvas.getContext("2d");
}
//sounds
const SOUND_EXPLODE = "explode1";
const SOUND_SHOOT = "shoot1";
const SOUND_SAUCER_SHOOT = "saucershoot"
const MAX_SOUNDS = 9;
var soundPool = new Array();
var explodeSound;
var explodeSound2;
var explodeSound3;
var shootSound;
var shootSound2;
var shootSound3;
var saucershootSound;
var saucershootSound2;
var saucershootSound3;
var audioType;
//application states
const GAME_STATE_INIT = 0;
const GAME_STATE_WAIT_FOR_LOAD = 5;
const GAME_STATE_TITLE = 10;
const GAME_STATE_NEW_GAME = 20;
const GAME_STATE_NEW_LEVEL = 30;
const GAME_STATE_PLAYER_START = 40;
const GAME_STATE_PLAY_LEVEL = 50;
const GAME_STATE_PLAYER_DIE = 60;
const GAME_STATE_GAME_OVER = 70;
var currentGameState = 0;
var currentGameStateFunction = null;
//title screen
var titleStarted = false;
//game over screen
var gameOverStarted = false;
//objects for game play
//game environment
var score = 0;
var level = 0;
Search WWH ::




Custom Search