HTML and CSS Reference
In-Depth Information
context
.
fillStyle
=
'#000000'
;
context
.
fillRect
(
0
,
0
,
200
,
200
);
context
.
fillStyle
=
'#ffffff'
;
context
.
font
=
'20px sans-serif'
;
context
.
textBaseline
=
'top'
;
context
.
fillText
(
"Title Screen"
,
50
,
90
);
}
function
function
gameStatePlayLevel
() {
ConsoleLog
.
log
(
"appStateGamePlay"
);
}
function
function
gameStateGameOver
() {
ConsoleLog
.
log
(
"appStateGameOver"
);
}
function
function
runGame
(){
currentGameStateFunction
();
}
//*** application start
switchGameState
(
GAME_STATE_TITLE
);
//**** application loop
var
var
FRAME_RATE
=
40
;
var
var
intervalTime
=
1000
/
FRAME_RATE
;
gameLoop
();
function
function
gameLoop
() {
runGame
();
window
.
setTimeout
(
gameLoop
,
intervalTime
);
}
}
//***** object prototypes *****
//*** consoleLog util object
//create constructor
function
function
ConsoleLog
(){
}
//create function that will be added to the class
console_log
=
function
function
(
message
) {
iif
(
typeof
typeof
(
console
)
!==
'undefined'
&&
console
!=
null
null
) {