Hi!
can anyone tell me how to put some value on my "score" i already use
if (playState.score <= 3){
game.add.text(20, 20, "practice more",{font: '50px Sports World', fill: '#b7e2fe'});
but it doenst work
var winState = {
create: function () {
game.add.tileSprite( 0, 0, 1000, 490, "background3")
if (playState.score >= loadState.hiscore) {
loadState.hiscore = playState.score;
}
var hiscoreLabel = game.add.text(473, 155, loadState.hiscore, {font: '50px Sports World', fill: '#fdf59e'});
var scoreLabel = game.add.text(473, 243, playState.score, {font: '50px Sports World', fill: '#b7e2fe'});;
var spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
spaceKey.onDown.addOnce (this.restart, this);
var escKey = game.input.keyboard.addKey(Phaser.Keyboard.ESC)
escKey.onDown.addOnce (this.menus, this);
},
restart: function (){
game.state.start('play');
},
menus: function (){
game.state.start('menu');
},
}
thats my code pls help me thank you!