|
001 packagepackage is used to name the directory or folder a class is in john_mcclarty;
002
003 importimport means to make the classes and/or packages available in this program wiki.Wiki;
004 importimport means to make the classes and/or packages available in this program fang.*;
005 importimport means to make the classes and/or packages available in this program java.awt.*;
006 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
007
008 /**
009 * Ugly face
010 * @authorthis is the Javadoc tag for documenting who created the source code John McClarty
011 */
012 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 SpriteMosaic extendsextends means to customize or extend the functionality of a class Game
013 {open braces start code blocks and must be matched with a close brace
014 /**sets up the game*/
015 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
016 {open braces start code blocks and must be matched with a close brace
017 //PieSprite - johnpie1
018 PieSprite johnpie1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(2, 2, 60, 180);
019 johnpie1.setColor(Palette.getColor("RED"));
020 johnpie1.setSize(0.3);
021 johnpie1.setLocation(0.25, 0.45);
022 addSprite(johnpie1);
023
024 //PieSprite - johnpie2
025 PieSprite johnpie2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(2,2,240,360);
026 johnpie2.setColor(Palette.getColor("Red"));
027 johnpie2.setSize(0.3);
028 johnpie2.setLocation(0.75,0.47);
029 addSprite(johnpie2);
030
031 //Triangle - johntriangle
032 PolygonSprite johntriangle=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(3);
033 johntriangle.setSize(0.2);
034 johntriangle.setLocation(0.5,0.6);
035 johntriangle.setColor(Palette.getColor("Dark Olive Green"));
036 addSprite(johntriangle);
037
038 //Wolf image
039 ImageSprite Wolfpic=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite ("Gray_wolf.jpg");
040 Wolfpic.setSize(0.35);
041 Wolfpic.setLocation(0.9,0.85);
042 addSprite(Wolfpic);
043
044 //Line sprites
045 LineSprite line1;
046 line1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(0,0,1,1);
047 line1.setSize(0.25);
048 line1.setLocation(0.34, 0.28);
049 line1.setColor(Palette.getColor("Yellow"));
050 addSprite(line1);
051
052 LineSprite thickline;
053 thickline=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(1,0,0,1);
054 thickline.setSize(0.25);
055 thickline.setLocation(0.66,0.28);
056 thickline.setColor(Palette.getColor("Green"));
057 thickline.setLineThickness(0.1);
058 addSprite(thickline);
059
060 //Add circle
061 OvalSprite circlej;
062 circlej=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1,1);
063 circlej.setSize(0.1);
064 circlej.setLocation(0.25,0.45);
065 circlej.setColor(Palette.getColor("Cornflower Blue"));
066 addSprite(circlej);
067
068 //Add oval
069 OvalSprite ovalj;
070 ovalj=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(0.75,0.25);
071 ovalj.setSize(0.35);
072 ovalj.setLocation(0.5,0.85);
073 ovalj.setColor(Palette.getColor("Crimson"));
074 addSprite(ovalj);
075
076 //Add Pentagon
077 PolygonSprite pentaj;
078 pentaj=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(5);
079 pentaj.setSize(0.1);
080 pentaj.setLocation(0.75,0.45);
081 pentaj.setColor(Palette.getColor("Cornflower Blue"));
082 addSprite(pentaj);
083
084 //Add Custom Polygon
085 PolygonSprite customj;
086 customj=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(3,6,1,5,4,0);
087 customj.setSize(0.15);
088 customj.setLocation(0.6,0.75);
089 customj.setColor(Palette.getColor("Ivory"));
090 addSprite(customj);
091
092 PolygonSprite custom2;
093 custom2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(6,0,1,3,8,8,12,5);
094 custom2.setSize(0.15);
095 custom2.setLocation(0.4,0.78);
096 custom2.setColor(Palette.getColor("Ivory"));
097 addSprite(custom2);
098
099 //Add Rectangles
100 RectangleSprite squarej;
101 squarej=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(0.5,0.5);
102 squarej.setSize(0.2);
103 squarej.setLocation(0.5,0.2);
104 squarej.setColor(Palette.getColor("Lime Green"));
105 addSprite(squarej);
106
107 RectangleSprite rectj;
108 rectj=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1,0.375);
109 rectj.setSize(0.3);
110 rectj.setLocation(0.5,0.2);
111 rectj.setColor(Palette.getColor("Maroon"));
112 addSprite(rectj);
113
114 //Add Arc Sprites
115 ArcSprite arc1;
116 arc1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(2,3,45,150);
117 arc1.setSize(0.2);
118 arc1.setLocation(0.25,0.32);
119 arc1.setColor(Palette.getColor("Chartreuse"));
120 addSprite(arc1);
121
122 ArcSprite arc2;
123 arc2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(2,3,225,330);
124 arc2.setSize(0.2);
125 arc2.setLocation(0.8,0.3);
126 arc2.setColor(Palette.getColor("Chartreuse"));
127 addSprite(arc2);
128
129 //Duke image
130 ImageSprite AuronFF10=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite ("Duke-Color-Logo.jpg");
131 AuronFF10.setSize(0.3);
132 AuronFF10.setLocation(0.1,0.14);
133 addSprite(AuronFF10);
134
135
136 //Author string
137 StringSprite name;
138 name=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("John McClarty");
139 name.setSize(0.35);
140 name.setLocation(0.5,0.95);
141 name.bottomJustify();
142 name.setColor(Palette.getColor("Blue"));
143 addSprite(name);
144
145 //Title string
146 StringSprite title;
147 title=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Game Face");
148 title.setSize(0.35);
149 title.setLocation(0.5,0.05);
150 title.topJustify();
151 title.setColor(Palette.getColor("Blue"));
152 addSprite(title);
153
154
155
156 }close braces end code blocks and must match an earlier open brace
157 }close braces end code blocks and must match an earlier open brace
|