-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTestClass.java
More file actions
80 lines (62 loc) · 2.08 KB
/
TestClass.java
File metadata and controls
80 lines (62 loc) · 2.08 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
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
import java.awt.*;
import java.util.Scanner;
import java.awt.Font;
import java.util.ArrayList;
/**
* Write a description of class TestClass here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class TestClass
{
public static void main(String args[]){
int width = 500;
int height = 500;
DrawingPanel panel = new DrawingPanel(width,height);
Graphics g = panel.getGraphics();
int R;
int G;
int B;
String dragonText;
Scanner scnr = new Scanner(System.in);
System.out.println("Type in RGB Numbers");
R = scnr.nextInt();
G = scnr.nextInt();
B = scnr.nextInt();
System.out.println("What do you want the dragon to say?");
dragonText = scnr.next();
Font myFont = new Font("ComicSans", Font.PLAIN, 12);
ArrayList<Dragon> dragons = new ArrayList<Dragon>();
Scene main = new Scene();
main.drawScene(g);
int num;
//ask the user how many dragons they want
do{
System.out.println("How many dragons do you want to make?");
num = scnr.nextInt();
}
while(num<=0);
//create the dragons
for(int i = 1; i <= num; i++){
Dragon temp = new Dragon(50*i +25, 50*i + 25, 1*i, R + i*10, G + i*5, B + i*7,"Fire", dragonText);
dragons.add(temp);
}
//Draw the dragons
for(int i = 0; i < dragons.size(); i++){
dragons.get(i).dragonElement(g);
dragons.get(i).drawDragon(g);
dragons.get(i).dragonSpeech(g);
}
/*Dragon Balerion = new Dragon();
Balerion.dragonElement(g);
Balerion.drawDragon(g);
System.out.println(Balerion);
Dragon David = new Dragon(250, 250, 2, R, G, B, "Water", "Hello There!");
David.dragonSpeech(g);
David.dragonElement(g);
David.drawDragon(g);
System.out.println(David);
*/
}
}