Hi everyone,
The game I’m making is a shooter: alienships fly across the screen and when I click them, they die.
I want to have a dynamic text that keeps score of the number of ships I kill, but I’m not managing to do it.
I have a “Main class” and an “Alienship class” in my game. This code is in the “Alienship class”:
function Alienship():void
{
addEventListener(MouseEvent.CLICK,whenclick);
}
private function whenclick(e:MouseEvent)
{
trace("You're dead
");
parent.removeChild(this);
}
It removes the alienship off the screen. But how can I have a variable that increments on each killing?
Thanks
Chiapa