From ggc
|
01 importimport means to make the classes and/or packages available in this program fang.*;
02 importimport means to make the classes and/or packages available in this program java.awt.*;
03 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
04 importimport means to make the classes and/or packages available in this program Beta.*;
05
06 /**
07 * All about my game here.
08 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
09 */
10 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 ArbitraryPathExample extendsextends means to customize or extend the functionality of a class GameLoop
11 {open braces start code blocks and must be matched with a close brace
12 /**an oval*/
13 privateprivate is used to restrict access to the current class only Sprite oval;
14 privateprivate is used to restrict access to the current class only OutlineTracker track;
15 /**sets up the game*/
16 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
17 {open braces start code blocks and must be matched with a close brace
18 makeSprites();
19 addSprites();
20 }close braces end code blocks and must match an earlier open brace
21
22 /**makes the sprites*/
23 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeSprites()
24 {open braces start code blocks and must be matched with a close brace
25 oval=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2, 1);
26 oval.setScale(0.75);
27 oval.setLocation(0.5, 0.5);
28 track=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OutlineTracker(0.2, 0, 0, 1, 1, 0, 0);
29 track.setLooping(truetrue is the boolean value that is the opposite of false);
30 oval.setTracker(track);
31 oval.setLocation(track.getCurrentPoint());
32 }close braces end code blocks and must match an earlier open brace
33
34 /**adds the sprites to the screen*/
35 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value addSprites()
36 {open braces start code blocks and must be matched with a close brace
37 canvas.addSprite(oval);
38 }close braces end code blocks and must match an earlier open brace
39 }close braces end code blocks and must match an earlier open brace
|
Compiler Errors:
----------
1. ERROR in ArbitraryPathExample.java (at line 14)
private OutlineTracker track;
^^^^^^^^^^^^^^
The type OutlineTracker is ambiguous
----------
2. ERROR in ArbitraryPathExample.java (at line 28)
track=new OutlineTracker(0.2, 0, 0, 1, 1, 0, 0);
^^^^^
track cannot be resolved
----------
6 problems (6 errors)
Download/View ArbitraryPathExample.java