Centred image on title screen.

This commit is contained in:
Rob Pearce 2016-08-20 15:38:10 +10:00
parent 2aad5e2a93
commit 657ca89d4e
2 changed files with 12 additions and 10 deletions

View File

@ -740,11 +740,11 @@ var game = {
this.context.fillStyle = gradient; this.context.fillStyle = gradient;
this.context.fillRect(0, 0, SCREENW, SCREENH); this.context.fillRect(0, 0, SCREENW, SCREENH);
// image // title image
ratio = SCREENW / img.width; ratio = SCREENW / img.width;
w = img.width * ratio; w = img.width * ratio;
h = img.height * ratio; h = img.height * ratio;
this.context.drawImage(img, 0, SCREENH - h, w, h); this.context.drawImage(img, SCREENW/16, SCREENH - h, w, h);
// text // text
this.context.textAlign = "center"; this.context.textAlign = "center";

18
todo
View File

@ -29,19 +29,21 @@ phone fixes as per http://www.html5rocks.com/en/mobile/touch/
https://www.smashingmagazine.com/2012/10/design-your-own-mobile-game/ https://www.smashingmagazine.com/2012/10/design-your-own-mobile-game/
*title screen bath time, then next level after getting sufficient llamas
*show final score on game over need 5 llamas on first level
*help text then 10, then 15, etc.
new levels:
obstacles
larger grid
new object types ?
bath time then next level after getting sufficient llamas? put commas in score
then each level, you need to get more llamas
what does bath time give you? use the bottom of the screen for something.
use requestanimframe
make path part of game object make path part of game object
make things part of game object make things part of game object