Tyler/DoorGameExperiment

From ggc

Jump to: navigation, search

001 package Tyler;
002 
003 import wiki.Wiki;
004 import fang.*;
005 import java.awt.*;
006 import java.awt.geom.*;
007 
008 /**
009  * All about my game here.
010  @author Tyler Walsh
011  */
012 
013 public class DoorGameExperiment extends GameLoop
014 
015 {
016   private int y;
017   private Sprite Box1;
018   private Sprite Box2;
019   private Sprite Box3;
020   private Sprite Door1;
021   private Sprite Door2;
022   private Sprite Door3;
023   private Sprite Dot1;
024   private Sprite Dot2;
025   private Sprite Dot3;
026   int x=random.nextInt(2);
027 
028 
029   /**sets up the game*/
030   public void startGame( )
031 
032 
033   {
034     makeSprites();
035     addSprites();
036     y=random.nextInt(3);
037 
038     {
039       if(y==0)
040       {
041         Dot1.setLocation(.18,.5);
042         Dot2.setLocation(.5,.5);
043         Dot3.setLocation(.8,.5);
044       }
045 
046       if (y==1)
047       {
048         Dot2.setLocation(.19,.5);
049         Dot1.setLocation(.5,.5);
050         Dot3.setLocation(.8,.5);
051       }
052 
053       if (y==2)
054       {
055         Dot3.setLocation(.21,.5);
056         Dot2.setLocation(.5,.5);
057         Dot1.setLocation(.8,.5);
058       }
059 
060     }
061 
062   }
063 
064 
065   private Sprite getMessage(String message)
066   {
067     StringSprite lose=new StringSprite("Tyler Rules");
068     lose.setScale(0.25);
069     lose.setLocation(0.50.25);
070     return lose;
071   }
072 
073 
074   {
075     Box1=new RectangleSprite(11);
076     Box1.setScale(0.25);
077     Box1.setLocation(0.50.5);
078     Box1.setColor(Color.ORANGE);
079 
080     Box2=new RectangleSprite(11);
081     Box2.setScale(.25);
082     Box2.setLocation(0.150.5);
083     Box2.setColor(Color.ORANGE);
084 
085     Box3=new RectangleSprite(1,1);
086     Box3.setScale(.25);
087     Box3.setLocation (0.850.5);
088     Box3.setColor(Color.ORANGE);
089 
090     Door1=new StringSprite("1");
091     Door1.setScale(.2);
092     Door1.setLocation(.14,.52);
093     Door1.setColor(Color.BLACK);
094 
095     Door2=new StringSprite("2");
096     Door2.setScale(.2);
097     Door2.setLocation(0.5,0.51);
098     Door2.setColor(Color.BLACK);
099 
100     Door3=new StringSprite("3");
101     Door3.setScale(.2);
102     Door3.setLocation(0.85,0.51);
103     Door3.setColor(Color.BLACK);
104 
105     Ellipse2D.Double circle=new Ellipse2D.Double(0,0,1,1);
106     Dot1=new Sprite(circle);
107     Dot1.setScale(.14);
108     Dot1.setColor(Color.GREEN);
109 
110     Dot2=new Sprite(circle);
111     Dot2.setScale(.14);
112     Dot2.setColor(Color.RED);
113 
114     Dot3=new Sprite(circle);
115     Dot3.setScale(.14);
116     Dot3.setColor(Color.RED);
117 
118 
119   }
120 
121   private void addSprites()
122 
123   {
124     message=getmessage("Tyler Rules");
125     canvas.addSprite(message);
126     canvas.addSprite(Dot1);
127     canvas.addSprite(Dot2);
128     canvas.addSprite(Dot3);
129     canvas.addSprite(Box1);
130     canvas.addSprite(Box2);
131     canvas.addSprite(Box3);
132     canvas.addSprite(Door1);
133     canvas.addSprite(Door2);
134     canvas.addSprite(Door3);
135 
136   }
137   public void advanceFrame(double timePassed)
138 
139 
140   {}
141 }

Compiler Errors:
----------
1. ERROR in Tyler/DoorGameExperiment.java (at line 34)
	makeSprites();
	^^^^^^^^^^^
The method makeSprites() is undefined for the type DoorGameExperiment
----------
2. ERROR in Tyler/DoorGameExperiment.java (at line 124)
	message=getmessage("Tyler Rules");
	^^^^^^^
message cannot be resolved
----------
4 problems (4 errors)

Download/View Tyler/DoorGameExperiment.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