Every time i die i wanna make a pop-up screen appear that lets u know that u died, your score and your maximum score so far. It looks like this:
public class DieScreen extends Entity { public function DieScreen(height:Number) { var heighttext:Text = new Text(height.toString(), 15, 53, { color: 0x000000 } ); var maxheighttext:Text = new Text(PlayerData.maxheight.toString(), 15, 88, {color: 0x000000} ); var back:Image = new Image(Assets.DIESCREEN); var display:Graphiclist = new Graphiclist(back, heighttext, maxheighttext); x = FP.camera.x + 25; y = FP.camera.y + 100; layer = -100; graphic = display; FP.log("diescreen placed"); } override public function update():void { super.update(); if (Input.pressed(Key.RIGHT)) { FP.world = new GameWorld(); } if (Input.pressed(Key.LEFT)) { FP.world = new MenuWorld(); } }
For some reason, when the height has more than one character (>= 10) the images don’t appear, but the log “diescreen placed” does trigger. Also everything freezes in place (i guess the world stops updating). Any ideas? I’m so lost.