From ggc
|
001 packagepackage is used to name the directory or folder a class is in Blake;
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 * All about my game here.
010 * @authorthis is the Javadoc tag for documenting who created the source code Blake Erskine
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 LetsMakeADeal extendsextends means to customize or extend the functionality of a class GameLoop
013 {open braces start code blocks and must be matched with a close brace
014 /**a door*/
015 privateprivate is used to restrict access to the current class only Sprite door1;
016 privateprivate is used to restrict access to the current class only Sprite door2;
017 privateprivate is used to restrict access to the current class only Sprite door3;
018 privateprivate is used to restrict access to the current class only Sprite prize1;
019 privateprivate is used to restrict access to the current class only Sprite prize2;
020 privateprivate is used to restrict access to the current class only Sprite prize3;
021 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer i;
022 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer clickcount =this assignment operator makes the left side equal to the right side 0;
023 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer ii;
024 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer doorpicked;
025 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer notopen;
026 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer open;
027 privateprivate is used to restrict access to the current class only Sprite crackerjack;
028 privateprivate is used to restrict access to the current class only StringSprite winmsg;
029 privateprivate is used to restrict access to the current class only StringSprite losemsg;
030
031
032 /**sets up the game*/
033 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
034 {open braces start code blocks and must be matched with a close brace
035 makeSprites();
036 addSprites();
037 }close braces end code blocks and must match an earlier open brace
038
039 /**makes the sprites*/
040 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeSprites()
041 {open braces start code blocks and must be matched with a close brace
042 /**Prizes*/
043 /**Prize 1*/
044 prize1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 2);
045 prize1.setScale(0.5);
046 prize1.setLocation(.2, 0.5);
047 prize1.setColor(Color.RED);
048 /**Prize 2*/
049 prize2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 2);
050 prize2.setScale(0.5);
051 prize2.setLocation(.5, 0.5);
052 prize2.setColor(Color.RED);
053 /**Prize 3*/
054 prize3=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 2);
055 prize3.setScale(0.5);
056 prize3.setLocation(.8, 0.5);
057 prize3.setColor(Color.GREEN);
058 /**Doors*/
059 /**Door 1*/
060 door1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 2);
061 door1.setScale(0.5);
062 door1.setLocation(.2, 0.5);
063 /**Door 2*/
064 door2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 2);
065 door2.setScale(0.5);
066 door2.setLocation(.5, 0.5);
067 /**Door 3*/
068 door3=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1, 2);
069 door3.setScale(0.5);
070 door3.setLocation(.8, 0.5);
071 /**Win Message*/
072 winmsg=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("You Win");
073 winmsg.scale(.5);
074 winmsg.setLocation(.5,.20);
075 /**Lose Message*/
076 losemsg=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("You Lose");
077 losemsg.scale(.5);
078 losemsg.setLocation(.5,.20);
079
080 crackerjack =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("Press q to Stay. Press w to Switch");
081 crackerjack.setLocation(.4, .1);
082 crackerjack.setScale(.5);
083 }close braces end code blocks and must match an earlier open brace
084
085 /**adds the sprites to the screen*/
086 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value addSprites()
087 {open braces start code blocks and must be matched with a close brace
088 canvas.addSprite(door1);
089 canvas.addSprite(door2);
090 canvas.addSprite(door3);
091
092 }close braces end code blocks and must match an earlier open brace
093
094 /**handle input and game events*/
095 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value advanceFrame(doubledouble is the type for numbers that can contain decimal fractions timePassed)
096 {open braces start code blocks and must be matched with a close brace
097 ifif executes the next statement only if the condition in parenthesis evaluates to true (getPlayer().getKeyboard().getLastKey() ==this is the comparison operator which evaluates to true if both sides are the same 'q')
098 {open braces start code blocks and must be matched with a close brace
099 ifif executes the next statement only if the condition in parenthesis evaluates to true (clickcount==this is the comparison operator which evaluates to true if both sides are the same1)
100 {open braces start code blocks and must be matched with a close brace
101 ii =this assignment operator makes the left side equal to the right side random.nextInt(2);
102 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same1 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 3)
103 {open braces start code blocks and must be matched with a close brace
104 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
105 {open braces start code blocks and must be matched with a close brace
106 prize3.setLocation(door1.getLocation());
107 prize2.setLocation(door3.getLocation());
108 canvas.addSprite(winmsg);
109 }close braces end code blocks and must match an earlier open brace
110 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
111 {open braces start code blocks and must be matched with a close brace
112 prize2.setLocation(door1.getLocation());
113 prize3.setLocation(door3.getLocation());
114 canvas.addSprite(losemsg);
115 }close braces end code blocks and must match an earlier open brace
116 }close braces end code blocks and must match an earlier open brace
117 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same1 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 2)
118 {open braces start code blocks and must be matched with a close brace
119 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
120 {open braces start code blocks and must be matched with a close brace
121 prize3.setLocation(door1.getLocation());
122 prize2.setLocation(door2.getLocation());
123 canvas.addSprite(winmsg);
124 }close braces end code blocks and must match an earlier open brace
125 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
126 {open braces start code blocks and must be matched with a close brace
127 prize2.setLocation(door1.getLocation());
128 prize3.setLocation(door2.getLocation());
129 canvas.addSprite(losemsg);
130 }close braces end code blocks and must match an earlier open brace
131 }close braces end code blocks and must match an earlier open brace
132 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same2 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 1)
133 {open braces start code blocks and must be matched with a close brace
134 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
135 {open braces start code blocks and must be matched with a close brace
136 prize3.setLocation(door2.getLocation());
137 prize2.setLocation(door1.getLocation());
138 canvas.addSprite(winmsg);
139 }close braces end code blocks and must match an earlier open brace
140 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
141 {open braces start code blocks and must be matched with a close brace
142 prize2.setLocation(door2.getLocation());
143 prize3.setLocation(door1.getLocation());
144 canvas.addSprite(losemsg);
145 }close braces end code blocks and must match an earlier open brace
146 }close braces end code blocks and must match an earlier open brace
147 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same2 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 3)
148 {open braces start code blocks and must be matched with a close brace
149 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
150 {open braces start code blocks and must be matched with a close brace
151 prize3.setLocation(door2.getLocation());
152 prize2.setLocation(door3.getLocation());
153 canvas.addSprite(winmsg);
154 }close braces end code blocks and must match an earlier open brace
155 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
156 {open braces start code blocks and must be matched with a close brace
157 prize2.setLocation(door2.getLocation());
158 prize3.setLocation(door3.getLocation());
159 canvas.addSprite(losemsg);
160 }close braces end code blocks and must match an earlier open brace
161 }close braces end code blocks and must match an earlier open brace
162 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same3 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 1)
163 {open braces start code blocks and must be matched with a close brace
164 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
165 {open braces start code blocks and must be matched with a close brace
166 prize3.setLocation(door3.getLocation());
167 prize2.setLocation(door1.getLocation());
168 canvas.addSprite(winmsg);
169 }close braces end code blocks and must match an earlier open brace
170 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
171 {open braces start code blocks and must be matched with a close brace
172 prize2.setLocation(door3.getLocation());
173 prize3.setLocation(door1.getLocation());
174 canvas.addSprite(losemsg);
175 }close braces end code blocks and must match an earlier open brace
176 }close braces end code blocks and must match an earlier open brace
177 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same3 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 2)
178 {open braces start code blocks and must be matched with a close brace
179 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
180 {open braces start code blocks and must be matched with a close brace
181 prize3.setLocation(door3.getLocation());
182 prize2.setLocation(door2.getLocation());
183 canvas.addSprite(winmsg);
184 }close braces end code blocks and must match an earlier open brace
185 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
186 {open braces start code blocks and must be matched with a close brace
187 prize2.setLocation(door3.getLocation());
188 prize3.setLocation(door1.getLocation());
189 canvas.addSprite(losemsg);
190 }close braces end code blocks and must match an earlier open brace
191 }close braces end code blocks and must match an earlier open brace
192
193 canvas.removeSprite(door1);
194 canvas.removeSprite(door2);
195 canvas.removeSprite(door3);
196 canvas.addSprite(prize2);
197 canvas.addSprite(prize3);
198 }close braces end code blocks and must match an earlier open brace
199 }close braces end code blocks and must match an earlier open brace
200
201 ifif executes the next statement only if the condition in parenthesis evaluates to true(getPlayer().getKeyboard().getLastKey() ==this is the comparison operator which evaluates to true if both sides are the same 'w')
202 ifif executes the next statement only if the condition in parenthesis evaluates to true (clickcount==this is the comparison operator which evaluates to true if both sides are the same1)
203 {open braces start code blocks and must be matched with a close brace
204 ii =this assignment operator makes the left side equal to the right side random.nextInt(2);
205 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same1 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 3)
206 {open braces start code blocks and must be matched with a close brace
207 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
208 {open braces start code blocks and must be matched with a close brace
209 prize3.setLocation(door1.getLocation());
210 prize2.setLocation(door3.getLocation());
211 canvas.addSprite(losemsg);
212 }close braces end code blocks and must match an earlier open brace
213 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
214 {open braces start code blocks and must be matched with a close brace
215 prize2.setLocation(door1.getLocation());
216 prize3.setLocation(door3.getLocation());
217 canvas.addSprite(winmsg);
218 }close braces end code blocks and must match an earlier open brace
219 }close braces end code blocks and must match an earlier open brace
220 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same1 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 2)
221 {open braces start code blocks and must be matched with a close brace
222 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
223 {open braces start code blocks and must be matched with a close brace
224 prize3.setLocation(door1.getLocation());
225 prize2.setLocation(door2.getLocation());
226 canvas.addSprite(losemsg);
227 }close braces end code blocks and must match an earlier open brace
228 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
229 {open braces start code blocks and must be matched with a close brace
230 prize2.setLocation(door1.getLocation());
231 prize3.setLocation(door2.getLocation());
232 canvas.addSprite(winmsg);
233 }close braces end code blocks and must match an earlier open brace
234 }close braces end code blocks and must match an earlier open brace
235 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same2 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 1)
236 {open braces start code blocks and must be matched with a close brace
237 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
238 {open braces start code blocks and must be matched with a close brace
239 prize3.setLocation(door2.getLocation());
240 prize2.setLocation(door1.getLocation());
241 canvas.addSprite(losemsg);
242 }close braces end code blocks and must match an earlier open brace
243 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
244 {open braces start code blocks and must be matched with a close brace
245 prize2.setLocation(door2.getLocation());
246 prize3.setLocation(door1.getLocation());
247 canvas.addSprite(winmsg);
248 }close braces end code blocks and must match an earlier open brace
249 }close braces end code blocks and must match an earlier open brace
250 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same2 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 3)
251 {open braces start code blocks and must be matched with a close brace
252 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
253 {open braces start code blocks and must be matched with a close brace
254 prize3.setLocation(door2.getLocation());
255 prize2.setLocation(door3.getLocation());
256 canvas.addSprite(losemsg);
257
258 }close braces end code blocks and must match an earlier open brace
259 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
260 {open braces start code blocks and must be matched with a close brace
261 prize2.setLocation(door2.getLocation());
262 prize3.setLocation(door3.getLocation());
263 canvas.addSprite(winmsg);
264 }close braces end code blocks and must match an earlier open brace
265 }close braces end code blocks and must match an earlier open brace
266 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same3 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 1)
267 {open braces start code blocks and must be matched with a close brace
268 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
269 {open braces start code blocks and must be matched with a close brace
270 prize3.setLocation(door3.getLocation());
271 prize2.setLocation(door1.getLocation());
272 canvas.addSprite(losemsg);
273 }close braces end code blocks and must match an earlier open brace
274 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
275 {open braces start code blocks and must be matched with a close brace
276 prize2.setLocation(door3.getLocation());
277 prize3.setLocation(door1.getLocation());
278 canvas.addSprite(winmsg);
279 }close braces end code blocks and must match an earlier open brace
280 }close braces end code blocks and must match an earlier open brace
281 ifif executes the next statement only if the condition in parenthesis evaluates to true (doorpicked==this is the comparison operator which evaluates to true if both sides are the same3 &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) notopen ==this is the comparison operator which evaluates to true if both sides are the same 2)
282 {open braces start code blocks and must be matched with a close brace
283 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 1)
284 {open braces start code blocks and must be matched with a close brace
285 prize3.setLocation(door3.getLocation());
286 prize2.setLocation(door2.getLocation());
287 canvas.addSprite(losemsg);
288 }close braces end code blocks and must match an earlier open brace
289 ifif executes the next statement only if the condition in parenthesis evaluates to true(ii ==this is the comparison operator which evaluates to true if both sides are the same 0)
290 {open braces start code blocks and must be matched with a close brace
291 prize2.setLocation(door3.getLocation());
292 prize3.setLocation(door1.getLocation());
293 canvas.addSprite(winmsg);
294 }close braces end code blocks and must match an earlier open brace
295 }close braces end code blocks and must match an earlier open brace
296
297 canvas.removeSprite(door1);
298 canvas.removeSprite(door2);
299 canvas.removeSprite(door3);
300 canvas.addSprite(prize2);
301 canvas.addSprite(prize3);
302 }close braces end code blocks and must match an earlier open brace
303 Point2D.Double click=this assignment operator makes the left side equal to the right sidegetPlayer().getMouse().getClickLocation();
304 //did they click at all
305 ifif executes the next statement only if the condition in parenthesis evaluates to true(click!=this is the not equals operator which evaluates to true if both sides are differentnullnull is the value used to refer to a non-existant object &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) clickcount ==this is the comparison operator which evaluates to true if both sides are the same 0)
306 {open braces start code blocks and must be matched with a close brace
307 ifif executes the next statement only if the condition in parenthesis evaluates to true(door1.intersects(click))
308 {open braces start code blocks and must be matched with a close brace
309 canvas.addSprite(crackerjack);
310 clickcount=this assignment operator makes the left side equal to the right side1;
311 intint is the type for whole numbers and it is short for integer i=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
312 doorpicked=this assignment operator makes the left side equal to the right side1;
313 ifif executes the next statement only if the condition in parenthesis evaluates to true(i==this is the comparison operator which evaluates to true if both sides are the same0)
314 {open braces start code blocks and must be matched with a close brace
315 prize1.setLocation(door2.getLocation());
316 canvas.removeSprite(door2);
317 canvas.addSprite(prize1);
318 open=this assignment operator makes the left side equal to the right side2;
319 notopen=this assignment operator makes the left side equal to the right side3;
320 }close braces end code blocks and must match an earlier open brace
321 ifif executes the next statement only if the condition in parenthesis evaluates to true(i==this is the comparison operator which evaluates to true if both sides are the same1)
322 {open braces start code blocks and must be matched with a close brace
323 prize1.setLocation(door3.getLocation());
324 canvas.removeSprite(door3);
325 canvas.addSprite(prize1);
326 open=this assignment operator makes the left side equal to the right side3;
327 notopen=this assignment operator makes the left side equal to the right side2;
328 }close braces end code blocks and must match an earlier open brace
329 }close braces end code blocks and must match an earlier open brace
330
331 ifif executes the next statement only if the condition in parenthesis evaluates to true(door2.intersects(click))
332 {open braces start code blocks and must be matched with a close brace
333 canvas.addSprite(crackerjack);
334 clickcount=this assignment operator makes the left side equal to the right side1;
335 intint is the type for whole numbers and it is short for integer t=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
336 doorpicked=this assignment operator makes the left side equal to the right side2;
337 ifif executes the next statement only if the condition in parenthesis evaluates to true(t==this is the comparison operator which evaluates to true if both sides are the same0)
338 {open braces start code blocks and must be matched with a close brace
339 prize1.setLocation(door1.getLocation());
340 canvas.removeSprite(door1);
341 canvas.addSprite(prize1);
342 open=this assignment operator makes the left side equal to the right side1;
343 notopen=this assignment operator makes the left side equal to the right side3;
344
345 }close braces end code blocks and must match an earlier open brace
346 ifif executes the next statement only if the condition in parenthesis evaluates to true(t==this is the comparison operator which evaluates to true if both sides are the same1)
347 {open braces start code blocks and must be matched with a close brace
348 prize1.setLocation(door3.getLocation());
349 canvas.removeSprite(door3);
350 canvas.addSprite(prize1);
351 open=this assignment operator makes the left side equal to the right side3;
352 notopen=this assignment operator makes the left side equal to the right side1;
353 }close braces end code blocks and must match an earlier open brace
354 }close braces end code blocks and must match an earlier open brace
355 ifif executes the next statement only if the condition in parenthesis evaluates to true(door3.intersects(click))
356 {open braces start code blocks and must be matched with a close brace
357 canvas.addSprite(crackerjack);
358 clickcount=this assignment operator makes the left side equal to the right side1;
359 intint is the type for whole numbers and it is short for integer r=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
360 doorpicked=this assignment operator makes the left side equal to the right side3;
361 ifif executes the next statement only if the condition in parenthesis evaluates to true(r==this is the comparison operator which evaluates to true if both sides are the same0)
362 {open braces start code blocks and must be matched with a close brace
363 prize1.setLocation(door2.getLocation());
364 canvas.removeSprite(door2);
365 canvas.addSprite(prize1);
366 open=this assignment operator makes the left side equal to the right side2;
367 notopen=this assignment operator makes the left side equal to the right side1;
368 }close braces end code blocks and must match an earlier open brace
369 ifif executes the next statement only if the condition in parenthesis evaluates to true(r==this is the comparison operator which evaluates to true if both sides are the same1)
370 {open braces start code blocks and must be matched with a close brace
371 prize1.setLocation(door1.getLocation());
372 canvas.removeSprite(door1);
373 canvas.addSprite(prize1);
374 open=this assignment operator makes the left side equal to the right side1;
375 notopen=this assignment operator makes the left side equal to the right side2;
376 }close braces end code blocks and must match an earlier open brace
377 }close braces end code blocks and must match an earlier open brace
378 }close braces end code blocks and must match an earlier open brace
379 }close braces end code blocks and must match an earlier open brace
380 }close braces end code blocks and must match an earlier open brace
|
Compiler Errors:
----------
1. WARNING in Blake/LetsMakeADeal.java (at line 12)
public class LetsMakeADeal extends GameLoop
^^^^^^^^^^^^^
The type LetsMakeADeal collides with a package
----------
1 problem (1 warning)
Download/View Blake/LetsMakeADeal.java