|
001 packagepackage is used to name the directory or folder a class is in Curtis;
002
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
007 /**
008 * Monty Hall.
009 * @authorthis is the Javadoc tag for documenting who created the source code: Curtis
010 */
011 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 MakeADeal extendsextends means to customize or extend the functionality of a class Game
012 {open braces start code blocks and must be matched with a close brace
013
014 //All Images and Texts
015 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer numClicks;
016 privateprivate is used to restrict access to the current class only ImageSprite door1, door2, door3, win, lose1, lose2;
017 privateprivate is used to restrict access to the current class only StringSprite start, first, second, third, choose, change, uwin, ulose;
018 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;
019 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer noopen;
020 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;
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 k;
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 j;
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 stage;
025
026
027 /**sets up the game*/
028 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
029 {open braces start code blocks and must be matched with a close brace
030 numClicks=this assignment operator makes the left side equal to the right side0;
031 stage=this assignment operator makes the left side equal to the right side0;
032
033 start=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Press Start");
034 start.setScale(.2);
035 start.setLocation(.1, .9);
036 start.setVisible(truetrue is the boolean value that is the opposite of false);
037 addSprite(start);
038
039 /*Doors*/
040 door1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("DoorCS.jpg");
041 door1.setScale(.45);
042 door1.setLocation(.2, .4);
043 addSprite(door1);
044
045 door2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("DoorCS.jpg");
046 door2.setScale(.45);
047 door2.setLocation(.5, .4);
048 addSprite(door2);
049
050 door3=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("DoorCS.jpg");
051 door3.setScale(.45);
052 door3.setLocation(.8, .4);
053 addSprite(door3);
054
055 /*Numbers*/
056 first=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("#1");
057 first.setSize(.1);
058 first.setLocation(.2, .7);
059 first.setColor(getColor("yellow"));
060 addSprite(first);
061
062 second=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("#2");
063 second.setSize(.1);
064 second.setLocation(.5, .7);
065 second.setColor(getColor("yellow"));
066 addSprite(second);
067
068 third=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("#3");
069 third.setSize(.1);
070 third.setLocation(.8, .7);
071 third.setColor(getColor("yellow"));
072 addSprite(third);
073
074 /*Text - Instructions*/
075 choose=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Choose A Door");
076 choose.setSize(.5);
077 choose.setLocation(.5, .1);
078 choose.setColor(getColor("yellow"));
079 addSprite(choose);
080
081 change=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Is That Your Final Answer");
082 change.setSize(.5);
083 change.setLocation(.5, .8);
084 change.setColor(getColor("yellow"));
085 change.setVisible(falsefalse is a value for the boolean type and means not true);
086 addSprite(change);
087
088 /*Win and Lose Images*/
089 win=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Win12333333.jpg");
090 win.setScale(.2);
091 win.setVisible(falsefalse is a value for the boolean type and means not true);
092 addSprite(win);
093
094 lose1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("LoseCS.jpg");
095 lose1.setScale(.25);
096 lose1.setVisible(falsefalse is a value for the boolean type and means not true);
097
098 lose2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("LoseCS.jpg");
099 lose2.setScale(.25);
100 lose2.setVisible(falsefalse is a value for the boolean type and means not true);
101 addSprite(lose2);
102
103 uwin=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("You Are Victorious");
104 uwin.setSize(.8);
105 uwin.setLocation(.5, .8);
106 uwin.setColor(getColor("yellow"));
107 uwin.setVisible(falsefalse is a value for the boolean type and means not true);
108 addSprite(uwin);
109
110 ulose=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("You Fail Epically");
111 ulose.setSize(.8);
112 ulose.setLocation(.5, .8);
113 ulose.setColor(getColor("yellow"));
114 ulose.setVisible(falsefalse is a value for the boolean type and means not true);
115 addSprite(ulose);
116
117 }close braces end code blocks and must match an earlier open brace
118
119 /**handle input and game events*/
120 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value advance()
121 {open braces start code blocks and must be matched with a close brace
122 ifif executes the next statement only if the condition in parenthesis evaluates to true(stage==this is the comparison operator which evaluates to true if both sides are the same0)
123 {open braces start code blocks and must be matched with a close brace
124
125 Point2D.Double click=this assignment operator makes the left side equal to the right sidegetPlayer().getMouse().getClickLocation();
126 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 &&) numClicks ==this is the comparison operator which evaluates to true if both sides are the same 0)
127 {open braces start code blocks and must be matched with a close brace
128 ifif executes the next statement only if the condition in parenthesis evaluates to true (door1.intersects(click))
129 //This is the number Randomizer
130 {open braces start code blocks and must be matched with a close brace
131 numClicks=this assignment operator makes the left side equal to the right side1;
132 i=this assignment operator makes the left side equal to the right siderandom.nextInt(2)+adds two numbers together or concatenates Strings together1;
133 doorpicked=this assignment operator makes the left side equal to the right side1;
134 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)
135 {open braces start code blocks and must be matched with a close brace
136 //if you click door 1
137 lose1.setLocation(door2.getLocation());
138 win.setLocation(door3.getLocation());
139 lose2.setLocation(door1.getLocation());
140 addSprite(lose1);
141 addSprite(win);
142 addSprite(lose2);
143 open=this assignment operator makes the left side equal to the right side2;
144 noopen=this assignment operator makes the left side equal to the right side3;
145 }close braces end code blocks and must match an earlier open brace
146 elseelse is what happens when the if condition is false 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 same2)
147 {open braces start code blocks and must be matched with a close brace
148 lose1.setLocation(door3.getLocation());
149 win.setLocation(door1.getLocation());
150 lose2.setLocation(door2.getLocation());
151 addSprite(lose1);
152 addSprite(win);
153 addSprite(lose2);
154 open=this assignment operator makes the left side equal to the right side3;
155 noopen=this assignment operator makes the left side equal to the right side2;
156 }close braces end code blocks and must match an earlier open brace
157 change.setVisible(truetrue is the boolean value that is the opposite of false);
158 lose1.setVisible(truetrue is the boolean value that is the opposite of false);
159 start.setVisible(falsefalse is a value for the boolean type and means not true);
160 choose.setVisible(falsefalse is a value for the boolean type and means not true);
161 stage=this assignment operator makes the left side equal to the right side1;
162 }close braces end code blocks and must match an earlier open brace
163
164 ifif executes the next statement only if the condition in parenthesis evaluates to true (door2.intersects(click))
165 //if you click door 2
166 {open braces start code blocks and must be matched with a close brace
167 numClicks=this assignment operator makes the left side equal to the right side1;
168 j=this assignment operator makes the left side equal to the right siderandom.nextInt(2)+adds two numbers together or concatenates Strings together1;
169 doorpicked=this assignment operator makes the left side equal to the right side2;
170 ifif executes the next statement only if the condition in parenthesis evaluates to true(j==this is the comparison operator which evaluates to true if both sides are the same1)
171 {open braces start code blocks and must be matched with a close brace
172 lose1.setLocation(door1.getLocation());
173 win.setLocation(door2.getLocation());
174 lose2.setLocation(door3.getLocation());
175 addSprite(lose1);
176 addSprite(win);
177 addSprite(lose2);
178 open=this assignment operator makes the left side equal to the right side1;
179 noopen=this assignment operator makes the left side equal to the right side3;
180 }close braces end code blocks and must match an earlier open brace
181 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true(j==this is the comparison operator which evaluates to true if both sides are the same2)
182 {open braces start code blocks and must be matched with a close brace
183 lose1.setLocation(door3.getLocation());
184 win.setLocation(door2.getLocation());
185 lose2.setLocation(door1.getLocation());
186 addSprite(lose1);
187 addSprite(win);
188 addSprite(lose2);
189 open=this assignment operator makes the left side equal to the right side3;
190 noopen=this assignment operator makes the left side equal to the right side1;
191 }close braces end code blocks and must match an earlier open brace
192 change.setVisible(truetrue is the boolean value that is the opposite of false);
193 lose1.setVisible(truetrue is the boolean value that is the opposite of false);
194 start.setVisible(falsefalse is a value for the boolean type and means not true);
195 choose.setVisible(falsefalse is a value for the boolean type and means not true);
196 stage=this assignment operator makes the left side equal to the right side1;
197 }close braces end code blocks and must match an earlier open brace
198 ifif executes the next statement only if the condition in parenthesis evaluates to true(door3.intersects(click))
199 //if you click door 3
200 {open braces start code blocks and must be matched with a close brace
201 numClicks=this assignment operator makes the left side equal to the right side1;
202 k=this assignment operator makes the left side equal to the right siderandom.nextInt(2)+adds two numbers together or concatenates Strings together1;
203 doorpicked=this assignment operator makes the left side equal to the right side3;
204 ifif executes the next statement only if the condition in parenthesis evaluates to true(k==this is the comparison operator which evaluates to true if both sides are the same1)
205 {open braces start code blocks and must be matched with a close brace
206 lose1.setLocation(door1.getLocation());
207 win.setLocation(door3.getLocation());
208 lose2.setLocation(door2.getLocation());
209 addSprite(lose1);
210 addSprite(win);
211 addSprite(lose2);
212 open=this assignment operator makes the left side equal to the right side1;
213 noopen=this assignment operator makes the left side equal to the right side2;
214 }close braces end code blocks and must match an earlier open brace
215 ifif executes the next statement only if the condition in parenthesis evaluates to true(k==this is the comparison operator which evaluates to true if both sides are the same2)
216 {open braces start code blocks and must be matched with a close brace
217 lose1.setLocation(door2.getLocation());
218 win.setLocation(door1.getLocation());
219 lose2.setLocation(door3.getLocation());
220 addSprite(lose1);
221 addSprite(win);
222 addSprite(lose2);
223 open=this assignment operator makes the left side equal to the right side2;
224 noopen=this assignment operator makes the left side equal to the right side1;
225 }close braces end code blocks and must match an earlier open brace
226 change.setVisible(truetrue is the boolean value that is the opposite of false);
227 lose1.setVisible(truetrue is the boolean value that is the opposite of false);
228 start.setVisible(falsefalse is a value for the boolean type and means not true);
229 choose.setVisible(falsefalse is a value for the boolean type and means not true);
230 stage=this assignment operator makes the left side equal to the right side1;
231 }close braces end code blocks and must match an earlier open brace
232 }close braces end code blocks and must match an earlier open brace
233 }close braces end code blocks and must match an earlier open brace
234 //On the second Click
235 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true (stage==this is the comparison operator which evaluates to true if both sides are the same1)
236 {open braces start code blocks and must be matched with a close brace
237
238 Point2D.Double click=this assignment operator makes the left side equal to the right sidegetPlayer().getMouse().getClickLocation();
239 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 &&) numClicks ==this is the comparison operator which evaluates to true if both sides are the same 1)
240
241
242 {open braces start code blocks and must be matched with a close brace
243 ifif executes the next statement only if the condition in parenthesis evaluates to true (door1.intersects(click) &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 &&) open==this is the comparison operator which evaluates to true if both sides are the same2)
244 {open braces start code blocks and must be matched with a close brace
245 numClicks=this assignment operator makes the left side equal to the right side2;
246 i=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
247 doorpicked=this assignment operator makes the left side equal to the right side1;
248 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)
249 {open braces start code blocks and must be matched with a close brace
250 lose2.setLocation(door1.getLocation());
251 win.setLocation(door3.getLocation());
252 addSprite(lose2);
253 addSprite(win);
254 ulose.setVisible(truetrue is the boolean value that is the opposite of false);
255 open=this assignment operator makes the left side equal to the right side2;
256 noopen=this assignment operator makes the left side equal to the right side3;
257 }close braces end code blocks and must match an earlier open brace
258 elseelse is what happens when the if condition is false 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 same2)
259 {open braces start code blocks and must be matched with a close brace
260 lose2.setLocation(door3.getLocation());
261 win.setLocation(door1.getLocation());
262 addSprite(lose2);
263 addSprite(win);
264 uwin.setVisible(truetrue is the boolean value that is the opposite of false);
265 win.setVisible(truetrue is the boolean value that is the opposite of false);
266 open=this assignment operator makes the left side equal to the right side3;
267 noopen=this assignment operator makes the left side equal to the right side2;
268 }close braces end code blocks and must match an earlier open brace
269 lose2.setVisible(truetrue is the boolean value that is the opposite of false);
270 change.setVisible(falsefalse is a value for the boolean type and means not true);
271 }close braces end code blocks and must match an earlier open brace
272 ifif executes the next statement only if the condition in parenthesis evaluates to true (door1.intersects(click) &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 &&) open==this is the comparison operator which evaluates to true if both sides are the same3)
273 {open braces start code blocks and must be matched with a close brace
274 numClicks=this assignment operator makes the left side equal to the right side2;
275 i=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
276 doorpicked=this assignment operator makes the left side equal to the right side1;
277 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)
278 {open braces start code blocks and must be matched with a close brace
279 lose2.setLocation(door1.getLocation());
280 win.setLocation(door2.getLocation());
281 addSprite(lose2);
282 addSprite(win);
283 ulose.setVisible(truetrue is the boolean value that is the opposite of false);
284 open=this assignment operator makes the left side equal to the right side2;
285 noopen=this assignment operator makes the left side equal to the right side3;
286 }close braces end code blocks and must match an earlier open brace
287 elseelse is what happens when the if condition is false 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 same2)
288 {open braces start code blocks and must be matched with a close brace
289 lose2.setLocation(door2.getLocation());
290 win.setLocation(door1.getLocation());
291 addSprite(lose2);
292 addSprite(win);
293 uwin.setVisible(truetrue is the boolean value that is the opposite of false);
294 win.setVisible(truetrue is the boolean value that is the opposite of false);
295 open=this assignment operator makes the left side equal to the right side3;
296 noopen=this assignment operator makes the left side equal to the right side2;
297 }close braces end code blocks and must match an earlier open brace
298 lose2.setVisible(truetrue is the boolean value that is the opposite of false);
299 change.setVisible(falsefalse is a value for the boolean type and means not true);
300 }close braces end code blocks and must match an earlier open brace
301
302 ifif executes the next statement only if the condition in parenthesis evaluates to true (door2.intersects(click) &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 &&) open==this is the comparison operator which evaluates to true if both sides are the same3)
303 {open braces start code blocks and must be matched with a close brace
304 numClicks=this assignment operator makes the left side equal to the right side2;
305 j=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
306 doorpicked=this assignment operator makes the left side equal to the right side2;
307 ifif executes the next statement only if the condition in parenthesis evaluates to true(j==this is the comparison operator which evaluates to true if both sides are the same1)
308 {open braces start code blocks and must be matched with a close brace
309 lose2.setLocation(door2.getLocation());
310 win.setLocation(door1.getLocation());
311 addSprite(lose2);
312 addSprite(win);
313 ulose.setVisible(truetrue is the boolean value that is the opposite of false);
314 open=this assignment operator makes the left side equal to the right side1;
315 noopen=this assignment operator makes the left side equal to the right side3;
316 }close braces end code blocks and must match an earlier open brace
317 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true(j==this is the comparison operator which evaluates to true if both sides are the same2)
318 {open braces start code blocks and must be matched with a close brace
319 lose2.setLocation(door1.getLocation());
320 win.setLocation(door2.getLocation());
321 addSprite(lose2);
322 addSprite(win);
323 uwin.setVisible(truetrue is the boolean value that is the opposite of false);
324 win.setVisible(truetrue is the boolean value that is the opposite of false);
325 open=this assignment operator makes the left side equal to the right side3;
326 noopen=this assignment operator makes the left side equal to the right side1;
327 }close braces end code blocks and must match an earlier open brace
328 lose2.setVisible(truetrue is the boolean value that is the opposite of false);
329 change.setVisible(falsefalse is a value for the boolean type and means not true);
330 }close braces end code blocks and must match an earlier open brace
331 ifif executes the next statement only if the condition in parenthesis evaluates to true (door2.intersects(click) &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 &&) open==this is the comparison operator which evaluates to true if both sides are the same1)
332 {open braces start code blocks and must be matched with a close brace
333 numClicks=this assignment operator makes the left side equal to the right side2;
334 j=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
335 doorpicked=this assignment operator makes the left side equal to the right side2;
336 ifif executes the next statement only if the condition in parenthesis evaluates to true(j==this is the comparison operator which evaluates to true if both sides are the same1)
337 {open braces start code blocks and must be matched with a close brace
338 lose2.setLocation(door2.getLocation());
339 win.setLocation(door3.getLocation());
340 addSprite(lose2);
341 addSprite(win);
342 ulose.setVisible(truetrue is the boolean value that is the opposite of false);
343 open=this assignment operator makes the left side equal to the right side1;
344 noopen=this assignment operator makes the left side equal to the right side3;
345 }close braces end code blocks and must match an earlier open brace
346 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true(j==this is the comparison operator which evaluates to true if both sides are the same2)
347 {open braces start code blocks and must be matched with a close brace
348 lose2.setLocation(door3.getLocation());
349 win.setLocation(door2.getLocation());
350 addSprite(lose2);
351 addSprite(win);
352 uwin.setVisible(truetrue is the boolean value that is the opposite of false);
353 win.setVisible(truetrue is the boolean value that is the opposite of false);
354 open=this assignment operator makes the left side equal to the right side3;
355 noopen=this assignment operator makes the left side equal to the right side1;
356 }close braces end code blocks and must match an earlier open brace
357 lose2.setVisible(truetrue is the boolean value that is the opposite of false);
358 change.setVisible(falsefalse is a value for the boolean type and means not true);
359 }close braces end code blocks and must match an earlier open brace
360 ifif executes the next statement only if the condition in parenthesis evaluates to true(door3.intersects(click) &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 &&) open==this is the comparison operator which evaluates to true if both sides are the same1)
361 {open braces start code blocks and must be matched with a close brace
362 numClicks=this assignment operator makes the left side equal to the right side2;
363 k=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
364 doorpicked=this assignment operator makes the left side equal to the right side3;
365 ifif executes the next statement only if the condition in parenthesis evaluates to true(k==this is the comparison operator which evaluates to true if both sides are the same1)
366 {open braces start code blocks and must be matched with a close brace
367 lose2.setLocation(door3.getLocation());
368 win.setLocation(door2.getLocation());
369 ulose.setVisible(truetrue is the boolean value that is the opposite of false);
370 addSprite(lose2);
371 addSprite(win);
372
373 open=this assignment operator makes the left side equal to the right side1;
374 noopen=this assignment operator makes the left side equal to the right side2;
375 }close braces end code blocks and must match an earlier open brace
376 ifif executes the next statement only if the condition in parenthesis evaluates to true(k==this is the comparison operator which evaluates to true if both sides are the same2)
377 {open braces start code blocks and must be matched with a close brace
378 lose2.setLocation(door2.getLocation());
379 win.setLocation(door3.getLocation());
380 addSprite(lose2);
381 addSprite(win);
382 uwin.setVisible(truetrue is the boolean value that is the opposite of false);
383 win.setVisible(truetrue is the boolean value that is the opposite of false);
384
385 open=this assignment operator makes the left side equal to the right side2;
386 noopen=this assignment operator makes the left side equal to the right side1;
387 }close braces end code blocks and must match an earlier open brace
388 lose2.setVisible(truetrue is the boolean value that is the opposite of false);
389 change.setVisible(falsefalse is a value for the boolean type and means not true);
390 stage=this assignment operator makes the left side equal to the right side2;
391 }close braces end code blocks and must match an earlier open brace
392 ifif executes the next statement only if the condition in parenthesis evaluates to true(door3.intersects(click) &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 &&) open==this is the comparison operator which evaluates to true if both sides are the same2)
393 {open braces start code blocks and must be matched with a close brace
394 numClicks=this assignment operator makes the left side equal to the right side2;
395 k=this assignment operator makes the left side equal to the right siderandom.nextInt(2);
396 doorpicked=this assignment operator makes the left side equal to the right side3;
397 ifif executes the next statement only if the condition in parenthesis evaluates to true(k==this is the comparison operator which evaluates to true if both sides are the same1)
398 {open braces start code blocks and must be matched with a close brace
399 lose2.setLocation(door3.getLocation());
400 win.setLocation(door1.getLocation());
401 ulose.setVisible(truetrue is the boolean value that is the opposite of false);
402 addSprite(lose2);
403 addSprite(win);
404
405 open=this assignment operator makes the left side equal to the right side1;
406 noopen=this assignment operator makes the left side equal to the right side2;
407 }close braces end code blocks and must match an earlier open brace
408 ifif executes the next statement only if the condition in parenthesis evaluates to true(k==this is the comparison operator which evaluates to true if both sides are the same2)
409 {open braces start code blocks and must be matched with a close brace
410 lose2.setLocation(door1.getLocation());
411 win.setLocation(door3.getLocation());
412 addSprite(lose2);
413 addSprite(win);
414 uwin.setVisible(truetrue is the boolean value that is the opposite of false);
415 win.setVisible(truetrue is the boolean value that is the opposite of false);
416
417 open=this assignment operator makes the left side equal to the right side2;
418 noopen=this assignment operator makes the left side equal to the right side1;
419 }close braces end code blocks and must match an earlier open brace
420 lose2.setVisible(truetrue is the boolean value that is the opposite of false);
421 change.setVisible(falsefalse is a value for the boolean type and means not true);
422 stage=this assignment operator makes the left side equal to the right side2;
423 }close braces end code blocks and must match an earlier open brace
424 }close braces end code blocks and must match an earlier open brace
425 }close braces end code blocks and must match an earlier open brace
426 }close braces end code blocks and must match an earlier open brace
427 }close braces end code blocks and must match an earlier open brace
|