O'Reilly logo

Haxe Game Development Essentials by Jeremy McCurdy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating LevelEndScreen

There's one last class to update. Open LevelEndScreen, and add the imports:

import ui.Strings;
import ui.StringIDs;

Go to the constructor and replace the line where the text property on txtGameScore is set with this:

txtGameScore.text = Strings.instance.getValue(StringIDs.SCORE) + score;

Next, go to the line where the text property on txtBestScore is set and replace it with:

txtBestScore.text = Strings.instance.getValue(StringIDs.BEST_SCORE) + Reg.score;

Finally, go to the line where btnPlayAgain is instantiated and replace it with this:

btnPlayAgain = new FlxButton(0, 0,Strings.instance.getValue(StringIDs.PLAY_AGAIN), onPlayAgain); 

Now with this, we're done! If you run the game now, it should look exactly as it did before, but ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required