|
-
need help creating a class for scores in a game
hey i've been trying to create a class for keeping track of a players score in a game, and giving them a ranking based on their score.
What i have so far is:
class score {
private var points: Number ;
private var rank: String ;
//constructor
function score(newpoints:Number, newrank:String){
points = newpoints ;
rank = newrank ;
}
//set methods
public function setpoints(p:Number) : Void {this.points = p ;}
public function setrank(rank:String) : Void {this.rank = rank ;}
//get methods
public function getpoints() : Number {return points;}
public function getrank() : String {return rank;}
Now what i was wondering is what i would need to add so it keeps track of their score and shows them their score when they lose.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|