diff --git a/cat.html b/cat.html index 95c3753..8b42c80 100644 --- a/cat.html +++ b/cat.html @@ -258,8 +258,11 @@ var llamatext = "llama"; var image = new Array(); var winimg = null; + +var nfonts = 0; var nimages = 0; var maximages = 0; +var maxfonts = 0; function loadimage(name, filename) { image[name] = new Image(); @@ -576,18 +579,6 @@ function getdir(thing1, thing2) { } function startGame() { - var i; - - imagenames = ['cat', 'catfull', 'catscared', 'llama', 'cheese', 'title', - 'goat','door','sunlight','lock','catwalkl','catwalkr','starfull','starempty' ]; - - - nimages = 0; - maximages = 0; - for (i in imagenames) { - maximages++; - loadimage(imagenames[i], 'images/' + imagenames[i] + '.png'); - } game.init(); game.initlevels(); @@ -987,12 +978,14 @@ var game = { }, incloadprogress : function() { - nimages++; - console.log(nimages + " / " + maximages + " images loaded."); + setTimeout(function () { + nimages++; + console.log(nimages + " / " + maximages + " images loaded."); + }, (rnd(3)+1) * 1000); }, drawloader : function() { - var bgcol = "#00ccff"; + var bgcol = "#008c8c"; var pct = nimages / maximages; ctx.fillStyle = bgcol; @@ -3381,9 +3374,14 @@ console.log("lev " + lev + " newwid " + newwid + " ratio " + ratio); }, setstate : function(newstate) { + + + console.log("setstate() = " + newstate); + if (newstate != this.state) { this.dirty = true; } + if (newstate == "help") { // decide which word to use if (onein(2)) { @@ -3438,12 +3436,22 @@ console.log("lev " + lev + " newwid " + newwid + " ratio " + ratio); // start fade in wipe.start("", "in", 15); } else if (newstate == "loader") { + // start loading images + var i; + + imagenames = ['cat', 'catfull', 'catscared', 'llama', 'cheese', 'title', + 'goat','door','sunlight','lock','catwalkl','catwalkr','starfull','starempty' ]; - + nfonts = 0; + maxfonts = 0; + nimages = 0; + maximages = 0; + for (i in imagenames) { + maximages++; + loadimage(imagenames[i], 'images/' + imagenames[i] + '.png'); + } } - console.log("setstate() = " + newstate); - this.state = newstate; }, diff --git a/todo b/todo index 5c2601c..f920948 100644 --- a/todo +++ b/todo @@ -8,15 +8,10 @@ https://www.smashingmagazine.com/2012/10/design-your-own-mobile-game/ ---------- -*game is correct size on phone but HUGE in browsers! -* scale to highest dimension. - -loading screen - white outline ? -foot - cats push it, clear the horiz. line. +foot/human - cats push it, clear the horiz. line. powerups get by... doors ?