Added screenshots, new level, and balanced the game
[AntiTD.git] / src / se / umu / cs / dit06ajnajs / Player.java
blobe1da8a95122c476a6d3c6f8c1f998bd96af6786e
1 package se.umu.cs.dit06ajnajs;
3 public class Player {
5 private String name;
6 private int credit;
7 private int score;
8 private int currentLevel;
9 private int savedScore;
11 public Player() {
12 this.name = "Unnamed player";
13 this.score = 0;
14 this.savedScore = 0;
15 this.currentLevel = 2;
16 initCredit();
19 public void setName(String name) {
20 this.name = name;
23 public String getName() {
24 return this.name;
27 public void addCredit(int credit) {
28 this.credit += credit;
29 this.score += credit;
32 public void removeCredit(int credit) {
33 this.credit -= credit;
36 public void initCredit() {
37 this.credit = 5000;
40 public void setCurrentLevel(int num) {
41 this.currentLevel = num;
44 public void saveScore() {
45 this.savedScore = score;
48 /**
49 * Resets the current score to the last saved score
51 public void loadSavedScore() {
52 this.score = this.savedScore;
55 public int getSavedScore() {
56 return this.savedScore;
59 public int getCredit() {
60 return this.credit;
63 public int getScore() {
64 return this.score;
67 public int getCurrentLevel() {
68 return this.currentLevel;