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.fillRect(0, 0, SCREENW, SCREENH);
// image
// title image
ratio = SCREENW / img.width;
w = img.width * 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
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/
*title screen
*show final score on game over
*help text
bath time, then next level after getting sufficient llamas
need 5 llamas on first level
then 10, then 15, etc.
new levels:
obstacles
larger grid
new object types ?
bath time then next level after getting sufficient llamas?
then each level, you need to get more llamas
what does bath time give you?
put commas in score
use the bottom of the screen for something.
use requestanimframe
make path part of game object
make things part of game object