From ggc
Beta.OutlineTracker has now been fixed.
|
01 packagepackage is used to name the directory or folder a class is in Jam;
02
03 importimport means to make the classes and/or packages available in this program java.awt.Color;
04 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
05 importimport means to make the classes and/or packages available in this program fang.*;
06 importimport means to make the classes and/or packages available in this program Beta.*;
07
08
09 /**This classclass is a group of fields and methods used for making objects is a good utility forfor is a looping structure for repeatedly executing a block of code testing
10 * out newly written trackers to make sure they
11 * move properly. It's usually easier to
12 * first test out the trackers using thisthis means the current object (the implicit parameter) classclass is a group of fields and methods used for making objects
13 * before adding them to more complex game
14 * code.
15 * @authornull Jam Jenkins
16 */
17 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 OutlineTrackerExample extendsextends means to customize or extend the functionality of a class GameLoop
18 {open braces start code blocks and must be matched with a close brace
19 /**sprite to move*/
20 privateprivate is used to restrict access to the current class only Sprite sprite;
21 /**tracker to move the sprite*/
22 privateprivate is used to restrict access to the current class only OutlineTracker tracker;
23
24 /**makes and adds the sprite to the screen*/
25 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
26 {open braces start code blocks and must be matched with a close brace
27 makeSprites();
28 addSprites();
29 }close braces end code blocks and must match an earlier open brace
30
31
32 /**makes an ellipse and sets it in
33 * motion given a tracker */
34 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeSprites()
35 {open braces start code blocks and must be matched with a close brace
36 sprite=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
37 sprite.setScale(0.05);
38 sprite.setLocation(0.5, 0.5);
39 //sprite.setBlurLength(25);
40
41 Sprite outline=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(5);
42 outline.setScale(0.5);
43 outline.setLocation(0.5, 0.5);
44 outline.setColor(Color.YELLOW);
45 canvas.addSprite(outline);
46
47 tracker=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OutlineTracker(outline, -0.5);
48 tracker.setLooping(truetrue is the boolean value that is the opposite of false);
49 sprite.setTracker(tracker);
50 sprite.setLocation(tracker.getCurrentPoint());
51 }close braces end code blocks and must match an earlier open brace
52
53 /**adds the sprite to the screen*/
54 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value addSprites()
55 {open braces start code blocks and must be matched with a close brace
56 canvas.addSprite(sprite);
57 }close braces end code blocks and must match an earlier open brace
58 }close braces end code blocks and must match an earlier open brace
|
Compiler Errors:
----------
1. ERROR in Jam/OutlineTrackerExample.java (at line 22)
private OutlineTracker tracker;
^^^^^^^^^^^^^^
The type OutlineTracker is ambiguous
----------
2. ERROR in Jam/OutlineTrackerExample.java (at line 47)
tracker=new OutlineTracker(outline, -0.5);
^^^^^^^
tracker cannot be resolved
----------
6 problems (6 errors)
Download/View Jam/OutlineTrackerExample.java