|
001 packagepackage is used to name the directory or folder a class is in TravVal;
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 Valerie Hagen and Travis Kirby
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 Breakout 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 privateprivate is used to restrict access to the current class only Sprite[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays bricks;
015 privateprivate is used to restrict access to the current class only Color[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays brickColor;
016 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer numBricksX, numBricksY;
017 privateprivate is used to restrict access to the current class only doubledouble is the type for numbers that can contain decimal fractions startYCoord, startXCoord;
018 privateprivate is used to restrict access to the current class only doubledouble is the type for numbers that can contain decimal fractions brickWidth, brickHeight;
019 privateprivate is used to restrict access to the current class only doubledouble is the type for numbers that can contain decimal fractions yCoord, xCoord;
020 privateprivate is used to restrict access to the current class only Sprite leftWall, rightWall, Floor, Ceiling;
021 privateprivate is used to restrict access to the current class only Sprite paddle, ball;
022 privateprivate is used to restrict access to the current class only Sprite scoreText, livesText, win, lose;
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 score, lives;
024 privateprivate is used to restrict access to the current class only booleanboolean is a type that is either true or false gameOver =this assignment operator makes the left side equal to the right side falsefalse is a value for the boolean type and means not true;
025 privateprivate is used to restrict access to the current class only ProjectileTracker ballTracker;
026 privateprivate is used to restrict access to the current class only doubledouble is the type for numbers that can contain decimal fractions normal;
027 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer brickAmount;
028 privateprivate is used to restrict access to the current class only SpriteFrame frame =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor SpriteFrame();
029 privateprivate is used to restrict access to the current class only Sound bounce;
030 privateprivate is used to restrict access to the current class only ImageSprite explosion;
031 privateprivate is used to restrict access to the current class only Sprite title;
032 privateprivate is used to restrict access to the current class only Color color=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Color (139, 69, 19);
033
034
035
036 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
037 {open braces start code blocks and must be matched with a close brace
038 toggleAudible();
039 makeSprites();
040 makeSounds();
041 makeExplosion();
042 makeOutcome();
043
044 setHelpText("Use the dog to get a score of 50 and recieve a touchdown! If you run out of lives, you fumble! Have fun!!");
045
046 title=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("UGA Breakout");
047 title.setLocation(0.5, 0.9);
048 title.setColor(Color.red);
049 title.setScale(.5);
050 canvas.addSprite(title);
051
052 }close braces end code blocks and must match an earlier open brace
053 publicpublic is used to indicate unrestricted access (any other class can have access) staticstatic means that an instance is not required for access (class level access) voidvoid means the method does not return a value mainThe main method is the place where applications begin executing.(String[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays args)
054 {open braces start code blocks and must be matched with a close brace
055
056 Breakout breakout =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor Breakout();
057
058 breakout.runAsApplication();
059 }close braces end code blocks and must match an earlier open brace
060
061 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeSprites()
062 {open braces start code blocks and must be matched with a close brace
063 lives =this assignment operator makes the left side equal to the right side 3;
064 score =this assignment operator makes the left side equal to the right side 0;
065 makeScoreLives();
066 levelAssign();
067 makeBrickColors();
068 makeBricks();
069 makeLevelBoundaries();
070 makePadBall();
071 makeBallTracker();
072 }close braces end code blocks and must match an earlier open brace
073
074 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeExplosion()
075 {open braces start code blocks and must be matched with a close brace
076 explosion =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("explosion.gif"));
077 explosion.setScale(.5);
078 }close braces end code blocks and must match an earlier open brace
079
080 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeSounds()
081 {open braces start code blocks and must be matched with a close brace
082 bounce=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor Sound(Wiki.getMedia("Quack.wav"));
083
084 }close braces end code blocks and must match an earlier open brace
085
086 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeScoreLives()
087 {open braces start code blocks and must be matched with a close brace
088 makescoreText();
089 makelivesText();
090 }close braces end code blocks and must match an earlier open brace
091
092 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makescoreText()
093 {open braces start code blocks and must be matched with a close brace
094 canvas.removeSprite(scoreText);
095 scoreText =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("Score: " +adds two numbers together or concatenates Strings together score);
096 scoreText.setLocation(0.3, .1);
097 scoreText.setColor(Color.WHITE);
098 scoreText.setScale(0.2);
099 canvas.addSprite(scoreText);
100 frame.addSprite(scoreText);
101 }close braces end code blocks and must match an earlier open brace
102
103 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makelivesText()
104 {open braces start code blocks and must be matched with a close brace
105 canvas.removeSprite(livesText);
106 livesText =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("Lives: " +adds two numbers together or concatenates Strings together lives);
107 livesText.setLocation(0.6, .1);
108 livesText.setColor(Color.WHITE);
109 livesText.setScale(0.2);
110 canvas.addSprite(livesText);
111 frame.addSprite(livesText);
112 }close braces end code blocks and must match an earlier open brace
113
114
115 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeBrickColors()
116 {open braces start code blocks and must be matched with a close brace
117 brickColor =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor Color[brackets are typically used to declare, initialize and index (indicate which element of) arraysnumBricksY]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
118 forfor is a looping structure for repeatedly executing a block of code(intint is the type for whole numbers and it is short for integer colorInt =this assignment operator makes the left side equal to the right side 0; colorInt < numBricksY; colorInt++this is the increment operator, which increases the variable by 1)
119 {open braces start code blocks and must be matched with a close brace
120 brickColor[brackets are typically used to declare, initialize and index (indicate which element of) arrayscolorInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side colorOrder(colorInt);
121 }close braces end code blocks and must match an earlier open brace
122 }close braces end code blocks and must match an earlier open brace
123
124 publicpublic is used to indicate unrestricted access (any other class can have access) Color colorOrder(intint is the type for whole numbers and it is short for integer colorNum)
125 {open braces start code blocks and must be matched with a close brace
126 Color colorReturn;
127 switchswitch is used with case for multiple alternatives (like if/else if...) (colorNum)
128 {open braces start code blocks and must be matched with a close brace
129 casecase is used with switch for multiple alternatives (like if/else if...) 0: colorReturn =this assignment operator makes the left side equal to the right side Color.red;
130 breakbreak terminates the loop immediately;
131 casecase is used with switch for multiple alternatives (like if/else if...) 1: colorReturn =this assignment operator makes the left side equal to the right side Color.red;
132 breakbreak terminates the loop immediately;
133 casecase is used with switch for multiple alternatives (like if/else if...) 2: colorReturn=this assignment operator makes the left side equal to the right sideColor.red;
134
135 defaultdefault is what is executed when no cases are matched: colorReturn =this assignment operator makes the left side equal to the right side Color.white;
136 }close braces end code blocks and must match an earlier open brace
137 returnreturn means to provide the result of the method and/or cease execution of the method immediately(colorReturn);
138 }close braces end code blocks and must match an earlier open brace
139
140 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeBricks()
141 {open braces start code blocks and must be matched with a close brace
142 bricks =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor Sprite[brackets are typically used to declare, initialize and index (indicate which element of) arraysnumBricksX * numBricksY]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
143 forfor is a looping structure for repeatedly executing a block of code (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 side 0; i < numBricksY; i++this is the increment operator, which increases the variable by 1)
144 {open braces start code blocks and must be matched with a close brace
145 yCoord =this assignment operator makes the left side equal to the right side startYCoord - (i * brickHeight);
146 forfor is a looping structure for repeatedly executing a block of code (intint is the type for whole numbers and it is short for integer a =this assignment operator makes the left side equal to the right side 0; a < numBricksX; a++this is the increment operator, which increases the variable by 1)
147 {open braces start code blocks and must be matched with a close brace
148 xCoord =this assignment operator makes the left side equal to the right side startXCoord +adds two numbers together or concatenates Strings together a * brickWidth;
149 bricks[brackets are typically used to declare, initialize and index (indicate which element of) arrays(i * numBricksX) +adds two numbers together or concatenates Strings together a]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite(brickWidth, brickHeight);
150 bricks[brackets are typically used to declare, initialize and index (indicate which element of) arrays(i * numBricksX) +adds two numbers together or concatenates Strings together a]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(brickColor[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays);
151 bricks[brackets are typically used to declare, initialize and index (indicate which element of) arrays(i * numBricksX) +adds two numbers together or concatenates Strings together a]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setLocation(xCoord, yCoord);
152 bricks[brackets are typically used to declare, initialize and index (indicate which element of) arrays(i * numBricksX) +adds two numbers together or concatenates Strings together a]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setScale(0.05);
153 canvas.addSprite(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arrays(i * numBricksX) +adds two numbers together or concatenates Strings together a]brackets are typically used to declare, initialize and index (indicate which element of) arrays);
154 frame.addSprite(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arrays(i * numBricksX) +adds two numbers together or concatenates Strings together a]brackets are typically used to declare, initialize and index (indicate which element of) arrays);
155 }close braces end code blocks and must match an earlier open brace
156 }close braces end code blocks and must match an earlier open brace
157 brickAmount =this assignment operator makes the left side equal to the right side bricks.length;
158 }close braces end code blocks and must match an earlier open brace
159
160
161 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value levelAssign()
162 {open braces start code blocks and must be matched with a close brace
163
164 numBricksX=this assignment operator makes the left side equal to the right side8;
165 numBricksY =this assignment operator makes the left side equal to the right side 4;
166 startYCoord =this assignment operator makes the left side equal to the right side .4;
167 startXCoord =this assignment operator makes the left side equal to the right side .1;
168 brickWidth =this assignment operator makes the left side equal to the right side (1 - 2 * startXCoord) / (numBricksX - 1);
169 brickHeight =this assignment operator makes the left side equal to the right side brickWidth / 2.5;
170 }close braces end code blocks and must match an earlier open brace
171
172 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeLevelBoundaries()
173 {open braces start code blocks and must be matched with a close brace
174 makeFloor();
175 makeCeiling();
176 makeLeftWall();
177 makeRightWall();
178 }close braces end code blocks and must match an earlier open brace
179
180
181 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeCeiling()
182 {open braces start code blocks and must be matched with a close brace
183 Ceiling=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite(10, .5);
184 Ceiling.setLocation(.5, .17);
185 Ceiling.setColor(Color.red);
186 canvas.addSprite(Ceiling);
187 frame.addSprite(Ceiling);
188 }close braces end code blocks and must match an earlier open brace
189
190 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeLeftWall()
191 {open braces start code blocks and must be matched with a close brace
192 leftWall =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite(1, 10);
193 leftWall.setLocation(startXCoord / 4, .5);
194 leftWall.setColor(Color.red);
195 canvas.addSprite(leftWall);
196 frame.addSprite(leftWall);
197 }close braces end code blocks and must match an earlier open brace
198
199 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeRightWall()
200 {open braces start code blocks and must be matched with a close brace
201 rightWall=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite(1, 10);
202 rightWall.setLocation(1 - startXCoord / 4.5, .5);
203 rightWall.setColor(Color.red);
204 canvas.addSprite(rightWall);
205 frame.addSprite(rightWall);
206 }close braces end code blocks and must match an earlier open brace
207
208 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeFloor()
209 {open braces start code blocks and must be matched with a close brace
210 Floor=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(50, 1);
211 Floor.setLocation(0.5, 0.99);
212 Floor.setScale(1);
213 Floor.setColor(Color.BLACK);
214 canvas.addSprite(Floor);
215 }close braces end code blocks and must match an earlier open brace
216
217 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makePadBall()
218 {open braces start code blocks and must be matched with a close brace
219 makePaddle();
220 makeBall();
221 }close braces end code blocks and must match an earlier open brace
222
223 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makePaddle()
224 {open braces start code blocks and must be matched with a close brace
225 paddle =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("Dog.gif"));
226 paddle.setLocation(.5, .8);
227 paddle.setScale(.15);
228 canvas.addSprite(paddle);
229 frame.addSprite(paddle);
230 }close braces end code blocks and must match an earlier open brace
231
232 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeBall()
233
234 {open braces start code blocks and must be matched with a close brace
235 ball =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor OvalSprite(4, 2);
236 ball.setLocation(.5, .7);
237 ball.setColor(color);
238 ball.setScale(.03);
239 canvas.addSprite(ball);
240 frame.addSprite(ball);
241
242 }close braces end code blocks and must match an earlier open brace
243 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value randomColorBound()
244 {open braces start code blocks and must be matched with a close brace
245 ball.setColor(newnew is used to create objects by calling the constructor Color(random.nextInt()));
246 }close braces end code blocks and must match an earlier open brace
247
248 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value makeBallTracker()
249 {open braces start code blocks and must be matched with a close brace
250 ballTracker =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor ProjectileTracker(0.1, -.25);
251 ball.setTracker(ballTracker);
252 }close braces end code blocks and must match an earlier open brace
253
254 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value boundaryBounce()
255 {open braces start code blocks and must be matched with a close brace
256 ifif executes the next statement only if the condition in parenthesis evaluates to true (ball.intersects(paddle))
257 {open braces start code blocks and must be matched with a close brace
258 ifif executes the next statement only if the condition in parenthesis evaluates to true (ball.getLocation().y < paddle.getLocation().y)
259 {open braces start code blocks and must be matched with a close brace
260 ballBounce(paddle, ball);
261 bounce.play();
262 }close braces end code blocks and must match an earlier open brace
263 }close braces end code blocks and must match an earlier open brace
264 ifif executes the next statement only if the condition in parenthesis evaluates to true (ball.intersects(Ceiling))
265 {open braces start code blocks and must be matched with a close brace
266 ballBounce(Ceiling, ball);
267 bounce.play();
268 }close braces end code blocks and must match an earlier open brace
269 ifif executes the next statement only if the condition in parenthesis evaluates to true (ball.intersects(leftWall))
270 {open braces start code blocks and must be matched with a close brace
271 ballBounce(leftWall, ball);
272 bounce.play();
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 (ball.intersects(rightWall))
275 {open braces start code blocks and must be matched with a close brace
276 ballBounce(rightWall, ball);
277 bounce.play();
278 }close braces end code blocks and must match an earlier open brace
279 ifif executes the next statement only if the condition in parenthesis evaluates to true (ball.intersects(explosion))
280 {open braces start code blocks and must be matched with a close brace
281 canvas.removeSprite(explosion);
282 }close braces end code blocks and must match an earlier open brace
283 }close braces end code blocks and must match an earlier open brace
284
285
286 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value brickBounce()
287 {open braces start code blocks and must be matched with a close brace
288 forfor is a looping structure for repeatedly executing a block of code (intint is the type for whole numbers and it is short for integer brickInt =this assignment operator makes the left side equal to the right side 0; brickInt < bricks.length; brickInt++this is the increment operator, which increases the variable by 1)
289 {open braces start code blocks and must be matched with a close brace
290 ifif executes the next statement only if the condition in parenthesis evaluates to true (canvas.containsSprite(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arraysbrickInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays) &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 &&) ball.intersects(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arraysbrickInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays) &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 &&) bricks[brackets are typically used to declare, initialize and index (indicate which element of) arraysbrickInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays !=this is the not equals operator which evaluates to true if both sides are different nullnull is the value used to refer to a non-existant object)
291 {open braces start code blocks and must be matched with a close brace
292 score++this is the increment operator, which increases the variable by 1;
293 makeScoreLives();
294 ballBounce(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arraysbrickInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays, ball);
295 canvas.removeSprite(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arraysbrickInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays);
296 brickAmount--this is the decrement operator, which decreases the variable by 1;
297 explosion.setLocation(bricks[brackets are typically used to declare, initialize and index (indicate which element of) arraysbrickInt]brackets are typically used to declare, initialize and index (indicate which element of) arrays.getLocation());
298 explosion.setLooping(falsefalse is a value for the boolean type and means not true);
299 explosion.startAnimationNow();
300 canvas.addSprite(explosion);
301 }close braces end code blocks and must match an earlier open brace
302
303 ifif executes the next statement only if the condition in parenthesis evaluates to true(Floor.intersects(ball))
304 {open braces start code blocks and must be matched with a close brace
305 lives--this is the decrement operator, which decreases the variable by 1;
306
307 ball.setLocation(.5,.5);
308 makeOutcome();
309 }close braces end code blocks and must match an earlier open brace
310 }close braces end code blocks and must match an earlier open brace
311 }close braces end code blocks and must match an earlier open brace
312
313 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeOutcome()
314 {open braces start code blocks and must be matched with a close brace
315 ifif executes the next statement only if the condition in parenthesis evaluates to true(lives==this is the comparison operator which evaluates to true if both sides are the same0)
316 {open braces start code blocks and must be matched with a close brace
317 lose=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Fumble!");
318 lose.setLocation(0.5, 0.5);
319 lose.setScale(.4);
320 lose.setColor(Color.WHITE);
321 canvas.addSprite(lose);
322 canvas.removeSprite(ball, paddle);
323 }close braces end code blocks and must match an earlier open brace
324
325 ifif executes the next statement only if the condition in parenthesis evaluates to true(score==this is the comparison operator which evaluates to true if both sides are the same32)
326 {open braces start code blocks and must be matched with a close brace
327 win=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Touchdown!");
328 win.setLocation(0.5, 0.5);
329 win.setScale(.4);
330 win.setColor(Color.WHITE);
331 canvas.addSprite(win);
332 canvas.removeSprite(ball, paddle);
333 }close braces end code blocks and must match an earlier open brace
334
335 }close braces end code blocks and must match an earlier open brace
336
337
338 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value ballBounce(Sprite surface, Sprite ball)
339 {open braces start code blocks and must be matched with a close brace
340 normal =this assignment operator makes the left side equal to the right side Sprite.getNormalVector(surface.getShape(), ball.getShape());
341 ballTracker.bounce(normal);
342 }close braces end code blocks and must match an earlier open brace
343
344
345 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value win()
346 {open braces start code blocks and must be matched with a close brace
347 ifif executes the next statement only if the condition in parenthesis evaluates to true(brickAmount ==this is the comparison operator which evaluates to true if both sides are the same 0)
348 {open braces start code blocks and must be matched with a close brace
349 gameOver =this assignment operator makes the left side equal to the right side truetrue is the boolean value that is the opposite of false;
350 ball.setVisible(falsefalse is a value for the boolean type and means not true);
351 }close braces end code blocks and must match an earlier open brace
352 }close braces end code blocks and must match an earlier open brace
353
354
355 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)
356 {open braces start code blocks and must be matched with a close brace
357
358
359 frame.setCenter(.5, .5);
360 frame.rotate(0.00);
361 ifif executes the next statement only if the condition in parenthesis evaluates to true(gameOver ==this is the comparison operator which evaluates to true if both sides are the same falsefalse is a value for the boolean type and means not true)
362 {open braces start code blocks and must be matched with a close brace
363 paddle.setLocation(getPlayer().getMouse().getLocation().x, paddle.getLocation().y);
364 boundaryBounce();
365 brickBounce();
366 win();
367 }close braces end code blocks and must match an earlier open brace
368 }close braces end code blocks and must match an earlier open brace
369 }close braces end code blocks and must match an earlier open brace
370
|