8. Anatomy of a Game
LOGIC JavaScript code
GRAPHICS canvas
INPUT onkeydown, onmousedown
SOUND Audio
MUSIC Audio
MULTIPLAYER Ajax, Web sockets
GAME ASSETS Images, Audio, Video and Binary
supported by browsers
10. Gaming Logic
var main_state = {
preload: function() {
// Function called first to load all the assets
},
create: function() {
// Fuction called after 'preload' to setup the game
},
update: function() {
// Function called 60 times per second
},
};