From ggc
|
01 packagepackage is used to name the directory or folder a class is in arcade;
02 importimport means to make the classes and/or packages available in this program java.awt.Color;
03 importimport means to make the classes and/or packages available in this program java.awt.event.KeyEvent;
04
05 importimport means to make the classes and/or packages available in this program fang.*;
06
07 /**
08 * This classclass is a group of fields and methods used for making objects simply launches the ArcadeGame.
09 * @authornull Jam Jenkins
10 */
11 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 ArcadeLauncher extendsextends means to customize or extend the functionality of a class GameLoop
12 {open braces start code blocks and must be matched with a close brace
13 privateprivate is used to restrict access to the current class only ArcadeGame topLevel;
14
15 /**
16 * sets the level at which to start
17 */
18 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
19 {open braces start code blocks and must be matched with a close brace
20 ArcadeGame game=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcadeGame();
21 game.setName("Arcade 1");
22 game.addArcadeLevel(newnew is used to create objects by calling the constructor SampleLevel("Hello"));
23 game.addArcadeLevel(newnew is used to create objects by calling the constructor SampleLevel("Nice"));
24 game.addArcadeLevel(newnew is used to create objects by calling the constructor SampleLevel("Bye"));
25 ArcadeGame game2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcadeGame();
26 game2.setName("Arcade 2");
27 game2.addArcadeLevel(newnew is used to create objects by calling the constructor SampleLevel("Billy"));
28 game2.addArcadeLevel(newnew is used to create objects by calling the constructor SampleLevel("Goat"));
29 game2.addArcadeLevel(newnew is used to create objects by calling the constructor SampleLevel("Gruff"));
30 topLevel=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcadeGame();
31 topLevel.setName("Big One");
32 topLevel.addArcadeLevel(game);
33 topLevel.addArcadeLevel(game2);
34 topLevel.addArcadeLevel(newnew is used to create objects by calling the constructor WackadotArcade());
35 setNextLevel(topLevel);
36
37 StringSprite toFinish=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Press ESC\nto end game");
38 toFinish.rightJustify();
39 toFinish.bottomJustify();
40 toFinish.setScale(0.2);
41 toFinish.setLocation(0.98, 0.98);
42 toFinish.setColor(newnew is used to create objects by calling the constructor Color(255, 255, 0, 64));
43 canvas.addSprite(toFinish);
44 topLevel.persist(toFinish);
45 }close braces end code blocks and must match an earlier open brace
46
47 /**
48 * enables the Escape key to finish the level at any time
49 */
50 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 timeElapsed)
51 {open braces start code blocks and must be matched with a close brace
52 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 sameKeyEvent.VK_ESCAPE)
53 finishLevel();
54 ifif executes the next statement only if the condition in parenthesis evaluates to true(getLevelNumber()==this is the comparison operator which evaluates to true if both sides are the same0)
55 setNextLevel(topLevel);
56 }close braces end code blocks and must match an earlier open brace
57
58 /**
59 * runs the game as an application
60 * @paramnull args not used
61 */
62 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)
63 {open braces start code blocks and must be matched with a close brace
64 newnew is used to create objects by calling the constructor ArcadeLauncher().runAsApplication();
65 }close braces end code blocks and must match an earlier open brace
66 }close braces end code blocks and must match an earlier open brace
|
Compiler Errors:
----------
1. ERROR in arcade/WackadotArcade.java (at line 22)
addArcadeLevel(new JacobOlson.wackadot.WackadotLevel("Spots"));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
JacobOlson.wackadot.WackadotLevel cannot be resolved to a type
----------
----------
2. ERROR in Brandon/WackadotLevel.java (at line 30)
ast1 = new ImageSprite(Wiki.getMedia("Asteroid.gif"));
The constructor ImageSprite(URL) is undefined
----------
36. ERROR in Valerie/Wackadot
Download/View arcade/ArcadeLauncher.java