-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUzytkownik.java
More file actions
52 lines (42 loc) · 1.11 KB
/
Uzytkownik.java
File metadata and controls
52 lines (42 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import greenfoot.*;
import java.awt.*;
/**
* Write a description of class Uzytkownik here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Uzytkownik extends Actor
{
String nickname = "";
int wynik = 0;
int licznikBledow = 0;
/**
* Act - do whatever the Uzytkownik wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
setImage(new GreenfootImage("Gracz: " + this.nickname + " - Score: " + wynik + "; Highest wynik: " +
Statystyki.getInstance().wezNajwyzszyWynik(), 24, Color.GREEN, Color.BLACK));
}
public Uzytkownik(String nickname) {
this.nickname = nickname;
this.wynik = 0;
}
public void dodajPunkt() {
wynik++;
}
public void podniesLicznikBledow() {
licznikBledow++;
}
public int getScore() {
return wynik;
}
public int wezLicznikBledow() {
return licznikBledow;
}
public String getNickName() {
return nickname;
}
}