|
001 packagepackage is used to name the directory or folder a class is in derrick;
002 importimport means to make the classes and/or packages available in this program wiki.Wiki;
003 importimport means to make the classes and/or packages available in this program fang.*;
004 importimport means to make the classes and/or packages available in this program java.awt.*;
005 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
006 importimport means to make the classes and/or packages available in this program java.awt.Color;
007 /**
008 * My Frog.
009
010 * @authorthis is the Javadoc tag for documenting who created the source code Derrick Dixon
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
018 ImageSprite background=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Water_lilies.jpg");
019 background.setSize(1);
020 background.setLocation(0.5, 0.5);
021 addSprite(background);
022
023 OvalSprite oval=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2, 1);
024 oval.setColor(Palette.getColor("Yellow Green"));
025 oval.setSize(0.65);
026 oval.setLocation(0.5, 0.5);
027 addSprite(oval);
028
029 PolygonSprite backleg1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(0.05, 0.65, 0.25, 0.35, 0.5, 0.65);
030 backleg1.setColor(Palette.getColor("Yellow Green"));
031 backleg1.setSize(0.35);
032 backleg1.setLocation(0.8, 0.5);
033 addSprite(backleg1);
034
035 PolygonSprite backleg2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(0.5, 0.65, 0.75, 0.35, 0.95, 0.65);
036 backleg2.setColor(Palette.getColor("Yellow Green"));
037 backleg2.setSize(0.35);
038 backleg2.setLocation(0.2, 0.5);
039 addSprite(backleg2); OvalSprite eye1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2, 2);
040
041 eye1.setColor(Palette.getColor("WHITE"));
042 eye1.setSize(0.15);
043 eye1.setLocation(0.35, 0.35);
044 addSprite(eye1); OvalSprite eye2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2, 2);
045
046 eye2.setColor(Palette.getColor("WHITE"));
047 eye2.setSize(0.15);
048 eye2.setLocation(0.65, 0.35);
049 addSprite(eye2); OvalSprite pupil1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2, 2);
050
051 pupil1.setColor(Palette.getColor("BLACK"));
052 pupil1.setSize(0.1);
053 pupil1.setLocation(0.35, 0.35);
054 addSprite(pupil1); OvalSprite pupil2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2, 2);
055
056 pupil2.setColor(Palette.getColor("BLACK"));
057 pupil2.setSize(0.1);
058 pupil2.setLocation(0.65, 0.35);
059 addSprite(pupil2);
060
061 ArcSprite eyelid1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(2, 2, 0, 180);
062 eyelid1.setColor(Palette.getColor("Yellow Green"));
063 eyelid1.setSize(0.15);
064 eyelid1.setLocation(0.35, 0.3);
065 addSprite(eyelid1);
066
067 ArcSprite eyelid2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(2, 2, 0, 250);
068 eyelid2.setColor(Palette.getColor("Yellow Green"));
069 eyelid2.setSize(0.19);
070 eyelid2.setLocation(0.65, 0.33);
071 addSprite(eyelid2);
072
073
074 PieSprite random1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(2, 2, 0, 25);
075 random1.setColor(Palette.getColor("RED"));
076 random1.setSize(0.20);
077 random1.setLocation(0.78, 0.05);
078 addSprite(random1);
079
080
081
082 RectangleSprite nameplate1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(8, 2);
083 nameplate1.setColor(Palette.getColor("Red"));
084 nameplate1.setSize(0.4);
085 nameplate1.setLocation(0.5, 0.9);
086 addSprite(nameplate1);
087
088
089 RectangleSprite nameplate2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(2, 2);
090 nameplate2.setColor(Palette.getColor("Red"));
091 nameplate2.setSize(0.20);
092 nameplate2.setLocation(0.5, 0.1);
093 addSprite(nameplate2);
094
095
096 PolygonSprite nostril1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(4);
097 nostril1.setColor(Palette.getColor("Goldenrod"));
098 nostril1.setSize(0.05);
099 nostril1.setLocation(0.55, 0.5);
100 addSprite(nostril1);
101
102 PolygonSprite nostril2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(4);
103 nostril2.setColor(Palette.getColor("Goldenrod"));
104 nostril2.setSize(0.05);
105 nostril2.setLocation(0.45, 0.5);
106 addSprite(nostril2);
107
108 ArcSprite belly=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(2, 1, 180, 0);
109 belly.setColor(Palette.getColor("Gold"));
110 belly.setSize(0.65);
111 belly.setLocation(0.5, 0.65);
112 addSprite(belly);
113
114 PolygonSprite fleg1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(3);
115 fleg1.setColor(Palette.getColor("Yellow Green"));
116 fleg1.setSize(0.15);
117 fleg1.setLocation(0.75, 0.65);
118 addSprite(fleg1);
119
120 PolygonSprite fleg2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(3);
121 fleg2.setColor(Palette.getColor("Yellow Green"));
122 fleg2.setSize(0.15);
123 fleg2.setLocation(0.25, 0.65);
124 addSprite(fleg2);
125
126 LineSprite tounge=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(0.65, 0.55, 1, 0);
127 tounge.setColor(Palette.getColor("Red"));
128 tounge.setLineThickness(0.1);
129 addSprite(tounge);
130
131 LineSprite lineintounge=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(0.65, 0.55, 1, 0);
132 lineintounge.setColor(Palette.getColor("Black"));
133 lineintounge.setLineThickness(0.0);
134 addSprite(lineintounge);
135
136 PieSprite mouth=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(2, 2, 115, 0);
137 mouth.setColor(Palette.getColor("Black"));
138 mouth.setSize(0.1);
139 mouth.setLocation(0.65, 0.55);
140 addSprite(mouth);
141
142 StringSprite title=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Froggie");
143 title.setColor(Palette.getColor("Green"));
144 title.setSize(0.4);
145 title.setLocation(0.5,0.05);
146 title.topJustify();
147 addSprite(title);
148
149 StringSprite artistname=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Derrick");
150 artistname.setColor(Palette.getColor("Green"));
151 artistname.setSize(0.4);
152 artistname.setLocation(0.5,0.95);
153 artistname.bottomJustify();
154 addSprite(artistname);
155
156 ImageSprite fly=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Fly.jpg");
157 fly.setSize(0.2);
158 fly.setLocation(0.05, 0.10);
159 addSprite(fly);
160
161
162 }close braces end code blocks and must match an earlier open brace
163 }close braces end code blocks and must match an earlier open brace
|