Jam/OutlineTrackerExample

From ggc

Jump to: navigation, search

Beta.OutlineTracker has now been fixed.

01 package Jam;
02 
03 import java.awt.Color;
04 import java.awt.geom.*;
05 import fang.*;
06 import Beta.*;
07 
08 
09 /**This class is a good utility for 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 this class
13  * before adding them to more complex game
14  * code.
15  @author Jam Jenkins
16  */
17 public class OutlineTrackerExample extends GameLoop
18 {
19   /**sprite to move*/
20   private Sprite sprite;
21   /**tracker to move the sprite*/
22   private OutlineTracker tracker;
23 
24   /**makes and adds the sprite to the screen*/
25   public void startGame()
26   {
27     makeSprites();
28     addSprites();
29   }
30 
31 
32   /**makes an ellipse and sets it in
33    * motion given a tracker */
34   private void makeSprites()
35   {
36     sprite=new OvalSprite(11);
37     sprite.setScale(0.05);
38     sprite.setLocation(0.50.5);
39     //sprite.setBlurLength(25);
40 
41     Sprite outline=new PolygonSprite(5);
42     outline.setScale(0.5);
43     outline.setLocation(0.50.5);
44     outline.setColor(Color.YELLOW);
45     canvas.addSprite(outline);
46 
47     tracker=new OutlineTracker(outline, -0.5);
48     tracker.setLooping(true);
49     sprite.setTracker(tracker);
50     sprite.setLocation(tracker.getCurrentPoint());
51   }
52 
53   /**adds the sprite to the screen*/
54   private void addSprites()
55   {
56     canvas.addSprite(sprite);
57   }
58 }

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




Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter