HemendraPullay/EquallySpaced

From ggc

Jump to: navigation, search

01 package HemendraPullay;
02 
03 import wiki.Wiki;
04 import fang.*;
05 import java.awt.*;
06 import java.awt.geom.*;
07 
08 /**
09  * All about my game here.
10  @author Hpullay
11  */
12 public class EquallySpaced extends GameLoop
13 {
14   /**an oval*/
15   private Sprite rectangle;
16   private Sprite wall;
17   private Sprite moving;
18   private ProjectileTracker paddle;
19   private ProjectileTracker ballTracker;
20 
21 
22   /**sets up the game*/
23   public void startGame()
24   {
25     makeSprites();
26     addSprites();
27   }
28 
29   /**makes the sprites*/
30   private void makeSprites()
31   {
32     {
33       int numBricksHigh=4;
34       double startLocationY=0.25;
35       double endLocationY=1-startLocationY;
36       double distanceHigh=endLocationY-startLocationY;
37       for(int j=0; j<numBricksHigh; j++)
38       {
39         double y=j*distanceHigh/(numBricksHigh-1)+startLocationY;
40 
41         int numBricksAcross=10;
42         double startLocationX=0.1;
43         double endLocationX=1-startLocationX;
44         double distanceAcross=endLocationX-startLocationX;
45         for(int i=0; i<numBricksAcross; i++)
46         {
47           double x=i*distanceAcross/(numBricksAcross-1)+startLocationX;
48           rectangle=new RectangleSprite(21);
49           rectangle.setScale(0.08);
50           rectangle.setLocation(x,y/2);
51           rectangle.setColor(Color.RED);
52           canvas.addSprite(rectangle);
53 
54         }
55       }
56 
57 
58     }
59 
60   }
61 
62   private void paddle()
63   {
64     moving=new OvalSprite(1,1);
65     moving.setScale(.2);
66     moving.setLocation(10.5);
67 
68     paddle=new ProjectileTracker(0.250);
69     moving.setTracker(paddle);
70 
71     wall=new OvalSprite(2,1);
72     wall.setScale(0.5);
73     wall.setLocation(.5,1);
74   }
75 
76   /**adds the sprites to the screen*/
77   private void addSprites()
78   {
79     canvas.addSprite(rectangle);
80     canvas.addSprite(moving, wall);
81   }
82 
83   /**handle input and game events*/
84   public void advanceFrame(double timePassed)
85   {
86     double y=getPlayer().getMouse().getLocation().y;
87     wall.setLocation(wall.getLocation().x, y);
88 
89     if(wall.intersects(moving))
90     {
91       double normal=Sprite.getNormalVector(wall.getShape(), moving.getShape());
92       tracker.bounce(normal);
93     }
94 
95   }
96 }

Compiler Errors:
----------
1. ERROR in HemendraPullay/EquallySpaced.java (at line 92)
	tracker.bounce(normal);
	^^^^^^^
tracker cannot be resolved
----------
1 problem (1 error)

Download/View HemendraPullay/EquallySpaced.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