test code to check for font load
This commit is contained in:
parent
18cf0704f5
commit
5c9cc8d82b
17
cat.html
17
cat.html
|
@ -1259,6 +1259,19 @@ var game = {
|
|||
return this.rng.rndrange(min, max);
|
||||
},
|
||||
|
||||
isfontloaded : function() {
|
||||
var tempctx = this.stargoalbanner.getContext("2d");
|
||||
var size;
|
||||
tempctx.font = "50 pt " + FONT;
|
||||
size = tempctx.measureText("wwwww").width;
|
||||
console.log(size);
|
||||
|
||||
if (size >= 36) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
addfireworks : function() {
|
||||
var delay = 0;
|
||||
for (i = 0; i < FIREWORKCOUNT; i++) {
|
||||
|
@ -1343,6 +1356,7 @@ var game = {
|
|||
//this.canvas = document.createElement("canvas");
|
||||
this.canvas = document.getElementsByTagName('canvas')[0];
|
||||
this.stargoalbanner = document.createElement("canvas");
|
||||
this.temp = document.createElement("canvas");
|
||||
|
||||
this.hratio = SCREENH / SCREENW;
|
||||
this.wratio = SCREENW / SCREENH;
|
||||
|
@ -7773,8 +7787,11 @@ function mainloop() {
|
|||
game.drawloader();
|
||||
|
||||
if (nimages >= maximages) {
|
||||
// has font loaded?
|
||||
if (game.isfontloaded()) {
|
||||
game.setstate("title");
|
||||
}
|
||||
}
|
||||
} else if (game.state == "help") {
|
||||
game.clear();
|
||||
game.drawhelp();
|
||||
|
|
5
todo
5
todo
|
@ -34,17 +34,12 @@ arrow/signpost - cat parades bounce off and take out htings in the path
|
|||
|
||||
|
||||
PLAYTEST:
|
||||
... adjust point goal calculation code now that we have multiplier.
|
||||
... adjust # of turns per level
|
||||
|
||||
|
||||
|
||||
|
||||
foot/human/cat toy - adjacent cat pushes it, clear the horiz. line.
|
||||
|
||||
|
||||
|
||||
|
||||
show points for each element along path??
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue