|
|
|
@ -115,8 +115,11 @@ ig.module(
|
|
|
|
|
game_id: '642fc6c1e8', |
|
|
|
|
response: 'json' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
font: new ig.Font( 'media/lcddot.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'), |
|
|
|
|
background: new ig.Image('media/highscore_screen.png'), |
|
|
|
|
nameField: null, |
|
|
|
@ -167,13 +170,23 @@ ig.module(
|
|
|
|
|
else this.background.draw(0, 0); |
|
|
|
|
|
|
|
|
|
// Draw the current highscore if its loaded
|
|
|
|
|
var num = 1; |
|
|
|
|
if (ig.global.scores !== undefined) { |
|
|
|
|
var ypos = 50; |
|
|
|
|
var font = this.fontSmall; |
|
|
|
|
|
|
|
|
|
for (var i=0; i<ig.global.scores.length; 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; |
|
|
|
|
num++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -198,7 +211,7 @@ ig.module(
|
|
|
|
|
|
|
|
|
|
// XXX: Just for debug purpose
|
|
|
|
|
if (ig.input.pressed('highscore')) { |
|
|
|
|
ig.global.score = 1337; |
|
|
|
|
ig.global.score = Math.floor(Math.random()*1000)*1; |
|
|
|
|
ig.system.setGame(ScoreboardScreen); |
|
|
|
|
} |
|
|
|
|
this.parent(); |
|
|
|
|