highscore screen is shiny now :)
This commit is contained in:
parent
cfd4bb887c
commit
544b3d0323
4 changed files with 16 additions and 3 deletions
|
@ -115,8 +115,11 @@ ig.module(
|
||||||
game_id: '642fc6c1e8',
|
game_id: '642fc6c1e8',
|
||||||
response: 'json'
|
response: 'json'
|
||||||
},
|
},
|
||||||
|
|
||||||
font: new ig.Font( 'media/lcddot.font.png' ),
|
font: new ig.Font( 'media/lcddot.font.png' ),
|
||||||
fontSmall: new ig.Font( 'media/lcddot.small.font.png' ),
|
fontSmall: new ig.Font( 'media/lcddot.small.font.png' ),
|
||||||
|
fontSmallGrey: new ig.Font( 'media/lcddot.small.grey.font.png' ),
|
||||||
|
|
||||||
backgroundInput: new ig.Image('media/highscore_input_screen.png'),
|
backgroundInput: new ig.Image('media/highscore_input_screen.png'),
|
||||||
background: new ig.Image('media/highscore_screen.png'),
|
background: new ig.Image('media/highscore_screen.png'),
|
||||||
nameField: null,
|
nameField: null,
|
||||||
|
@ -167,13 +170,23 @@ ig.module(
|
||||||
else this.background.draw(0, 0);
|
else this.background.draw(0, 0);
|
||||||
|
|
||||||
// Draw the current highscore if its loaded
|
// Draw the current highscore if its loaded
|
||||||
|
var num = 1;
|
||||||
if (ig.global.scores !== undefined) {
|
if (ig.global.scores !== undefined) {
|
||||||
var ypos = 50;
|
var ypos = 50;
|
||||||
|
var font = this.fontSmall;
|
||||||
|
|
||||||
for (var i=0; i<ig.global.scores.length; i++) {
|
for (var i=0; i<ig.global.scores.length; i++) {
|
||||||
var score = ig.global.scores[i];
|
var score = ig.global.scores[i];
|
||||||
this.fontSmall.draw(score.Score.score + ' ' + score.Player.username, 50, ypos, ig.Font.ALIGN.RIGHT);
|
|
||||||
this.fontSmall.draw(score.Score.score + ' ' + score.Player.username, 50, ypos, ig.Font.ALIGN.LEFT);
|
if(num <= 3) font = this.fontSmall;
|
||||||
|
else font = this.fontSmallGrey;
|
||||||
|
|
||||||
|
font.draw(num, 60, ypos, ig.Font.ALIGN.CENTER);
|
||||||
|
font.draw(score.Score.score, 210, ypos, ig.Font.ALIGN.RIGHT);
|
||||||
|
font.draw(score.Player.username, 250, ypos, ig.Font.ALIGN.LEFT);
|
||||||
|
|
||||||
ypos += 30;
|
ypos += 30;
|
||||||
|
num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +211,7 @@ ig.module(
|
||||||
|
|
||||||
// XXX: Just for debug purpose
|
// XXX: Just for debug purpose
|
||||||
if (ig.input.pressed('highscore')) {
|
if (ig.input.pressed('highscore')) {
|
||||||
ig.global.score = 1337;
|
ig.global.score = Math.floor(Math.random()*1000)*1;
|
||||||
ig.system.setGame(ScoreboardScreen);
|
ig.system.setGame(ScoreboardScreen);
|
||||||
}
|
}
|
||||||
this.parent();
|
this.parent();
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 159 KiB |
Binary file not shown.
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 150 KiB |
BIN
dev/media/lcddot.small.grey.font.png
Normal file
BIN
dev/media/lcddot.small.grey.font.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Loading…
Reference in a new issue