Hi,
I’ve made a game, and its pretty much finishd.
Now I have one problem.
I have a working scoring system. That when you hit you gain points, miss is lose points. It works fine. Only problem is, then when you start. So before you hit/miss You have 0 points, but those points don’t show. Theyre not visible. (if you go to or below 0 later it remains visible) So its only at the start. Anyone know how I can have the starting score visible?
the 2cnd question is. I would like to add a timer to my game.
Like you start with 60secs. Then you see the timer go down each second. And after 60 seconds the timer hits 0 and the game stops.
Anyone know how to do this, or has a tut to that?
Thnx.
The code for the score is
package {
//Importeer benodigde classes.
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
public class Score extends Sprite {
public var myScore:TextField = new TextField();
public var myFormat:TextFormat = new TextFormat();
//Maak constructor functie.
public function Score() {
this.myScore.text=String(0);
}
public function Updatescore(Score) {
//Zorgt voor de score.
this.myScore.text=String(Score);
myScore.x=660;
myScore.y=30;
myScore.selectable=false;
addChild(myScore);
//Zorgt voor de textopmaak.
myFormat.color=0xFFFFFF;
myFormat.size=24;
myScore.setTextFormat(myFormat);
}
}
}