-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNPCText.java
105 lines (101 loc) · 1.9 KB
/
NPCText.java
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import greenfoot.*;
import java.awt.Color;
/**
* Write a description of class Text here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class NPCText extends NPC
{
static String[] names = {
"Snoop",
"Bob",
"Jim",
"Joey",
"Ian",
"Steff",
"Victor",
"Zahir",
"Lena",
"Greagory",
"Corelli",
"John",
"Thomas",
"Anthony",
"Leo",
"Lena",
"Berns",
"Michael",
"Richard",
"Daniel",
"George",
"Steven",
"David",
"Jared",
"Eric",
"Jordan",
"Mary",
"Maria",
"Deborah",
"Hillary",
"Bush",
"Ryan",
"Donald",
"Sanders",
"Jeb",
"Christie",
"Chris",
"Biden",
"Austin",
"Chafee",
"O'Malley",
"Trump",
"Webb",
"Martin",
"Carson",
"Adams",
"Everson",
"Graham",
"Huck",
"King",
"Caesar",
"Marcus",
"Roi",
"PK Thunder",
"X",
"Amour",
"Lin",
"Joyce",
"Oboey",
"Robbie",
"Lindsey",
"Jared",
"Hailey",
"Ryssa",
"Ren",
"Jalen",
"Hamrick",
"Eliza",
"Jay",
"Bennish",
"Jones"
};
/**
* Act - do whatever the Text wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
movement();
drift();
}
public NPCText()
{
generateName();
}
public void generateName(){
int rand = Greenfoot.getRandomNumber(names.length);
setImage(new GreenfootImage(names[rand], 12, Color.WHITE, Color.BLACK));
}
}