|
01 packagepackage is used to name the directory or folder a class is in Curtis;
02
03 importimport means to make the classes and/or packages available in this program wiki.Wiki;
04 importimport means to make the classes and/or packages available in this program fang.*;
05 importimport means to make the classes and/or packages available in this program java.awt.*;
06 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
07
08 /**
09 * All about my game here.
10 * @authorthis is the Javadoc tag for documenting who created the source code Curtis S.
11 */
12 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects SpriteMosaiCCS extendsextends means to customize or extend the functionality of a class Game
13 {open braces start code blocks and must be matched with a close brace
14 /**sets up the game*/
15 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
16 {open braces start code blocks and must be matched with a close brace
17 OvalSprite oval=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
18 oval.setSize(0.75);
19 oval.setLocation(0.5, 0.5);
20 oval.setColor(Palette.getColor("Aqua"));
21 addSprite(oval);
22
23 RectangleSprite rectangle=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 1);
24 rectangle.setSize(0.25);
25 rectangle.setLocation(0.5, 0.6);
26 rectangle.setColor(Palette.getColor("Midnight Blue"));
27 addSprite(rectangle);
28
29 PolygonSprite poly=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(6);
30 poly.setColor(Palette.getColor("Beige"));
31 poly.setSize(0.25);
32 poly.setLocation(0.25, 0.25);
33 addSprite(poly);
34
35 PieSprite pie=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(1, 1, 45, 270);
36 pie.setColor(Palette.getColor("Thistle"));
37 pie.setSize(0.18);
38 pie.setLocation(0.75, 0.25);
39 addSprite(pie);
40
41 ArcSprite arc=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(1, 1, 0, 180);
42 arc.setColor(Palette.getColor("Tomato"));
43 arc.setSize(0.18);
44 arc.setLocation(0.50, 0.50);
45 addSprite(arc);
46
47 LineSprite line=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(1, 1, 0, 180);
48 line.setSize(0.4);
49 line.setLocation(0.2, 0.2);
50 addSprite(line);
51
52 ButtonSprite button=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ButtonSprite("Hello People");
53 button.setSize(0.17);
54 button.setLocation(0.1, 0.1);
55 addSprite(button);
56
57 StringSprite bye=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Bye");
58 bye.setSize(0.2);
59 bye.setLocation(0.8, 0.8);
60 addSprite(bye);
61
62 ImageSprite piccs=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Fresh2colorCS.png");
63 piccs.setSize(0.2);
64 piccs.setLocation(0.4, 0.8);
65 addSprite(piccs);
66 }close braces end code blocks and must match an earlier open brace
67
68 }close braces end code blocks and must match an earlier open brace
|