Min/SpriteMosaic

From ggc

Jump to: navigation, search

001 package Min;
002 
003 import fang.*;
004 import java.awt.*;
005 import java.awt.geom.*;
006 
007 /**
008  * All about my game.
009  @author My Name Here
010  */
011 public class SpriteMosaic extends Game
012 {
013   /**sets up the game*/
014   public void setup()
015   {
016     //making circle, size about half middle of the screen color blue
017     OvalSprite circ;
018     circ = new OvalSprite(1,1);
019     circ.setSize(0.5);
020     circ.setLocation(0.50.5 );
021     circ.setColor(Palette.getColor("blue"));
022     addSprite(circ);
023 
024     //making oblong, size about .3 left side of the screen color orange
025     OvalSprite oval;
026     oval = new OvalSprite(6,3);
027     oval.setSize(0.3);
028     oval.setLocation (0.30.5);
029     oval.setColor(Palette.getColor("orange"));
030     addSprite(oval);
031 
032     //making oblong, size about .3 right side of the screen color orange
033     OvalSprite oval2;
034     oval2 = new OvalSprite(6,3);
035     oval2.setSize(0.3);
036     oval2.setLocation (0.70.5);
037     oval2.setColor(Palette.getColor("orange"));
038     addSprite(oval2);
039 
040     //making rectangle size .3 same side about middle down color red
041     RectangleSprite rect;
042     rect = new RectangleSprite(3,3);
043     rect.setSize(0.3);
044     rect.setLocation (0.50.8);
045     rect.setColor(Palette.getColor("red"));
046     addSprite(rect);
047 
048     //making rectangle size .1 one longer side about middle top color magenta
049     RectangleSprite rect2;
050     rect2 = new RectangleSprite(1,5);
051     rect2.setSize(0.1);
052     rect2.setLocation (0.50.3);
053     rect2.setColor(Palette.getColor("Magenta"));
054     addSprite(rect2);
055 
056     //making polygon size .1 5 side about left side middle color green
057     PolygonSprite poly;
058     poly = new PolygonSprite(5);
059     poly.setSize(.1);
060     poly.setLocation(0.30.5);
061     poly.setColor(Palette.getColor("green"));
062     addSprite(poly);
063 
064     //making polygon size .1 6 side about right side middle color green
065     PolygonSprite poly2;
066     poly2 = new PolygonSprite(6);
067     poly2.setSize(.1);
068     poly2.setLocation(0.70.5);
069     poly2.setColor(Palette.getColor("green"));
070     addSprite(poly2);
071 
072     //making polygon size .2 3 side about left side upper color cyan
073     PolygonSprite poly3;
074     poly3 = new PolygonSprite(0,0,0,1,0,1,1,1);
075     poly3.setSize(.2);
076     poly3.setLocation(0.30.3);
077     poly3.setColor(Palette.getColor("Cyan"));
078     addSprite(poly3);
079 
080     //making polygon size .2 3 side about right side upper color cyan
081     PolygonSprite poly4;
082     poly4 = new PolygonSprite(1,1,1,0,0,1,0,1);
083     poly4.setSize(.2);
084     poly4.setLocation(0.70.3);
085     poly4.setColor(Palette.getColor("Cyan"));
086     addSprite(poly4);
087 
088     //making thin line size .2 about top middle color white
089     LineSprite thin;
090     thin = new LineSprite(1,0,0,1);
091     thin.setSize(0.2);
092     thin.setLocation(0.50.25);
093     thin.setColor(Palette.getColor("white"));
094     addSprite(thin);
095 
096     //making thick line size .5 about top middle color white
097     LineSprite thick;
098     thick = new LineSprite(1,1,0,1);
099     thick.setSize(0.5);
100     thick.setLineThickness(.1);
101     thick.setLocation(0.50.25);
102     thick.setColor(Palette.getColor("white"));
103     addSprite(thick);
104 
105     //making pie size about .2 left bottom middle opening on the right side yellow
106     PieSprite pie;
107     pie = new PieSprite(3,2,90,10);
108     pie.setSize(0.2);
109     pie.setLocation(0.30.7);
110     pie.setColor(Palette.getColor("yellow"));
111     addSprite(pie);
112 
113     //making pie size about .2 right bottom middle opening on the left side yellow
114     PieSprite pie2;
115     pie2 = new PieSprite(2,3,200,120);
116     pie2.setSize(0.2);
117     pie2.setLocation(0.70.7);
118     pie2.setColor(Palette.getColor("yellow"));
119     addSprite(pie2);
120 
121     //making wierd arc
122     ArcSprite arc;
123     arc = new ArcSprite(1,1,120,50);
124     arc.setSize(0.1);
125     arc.setLocation (0.30.9);
126     arc.setColor(Palette.getColor("Yellow Green"));
127     addSprite(arc);
128 
129     //making wierd arc
130     ArcSprite arc2;
131     arc2 = new ArcSprite(2,1,200,100);
132     arc2.setSize(0.1);
133     arc2.setLocation (0.70.9);
134     arc2.setColor(Palette.getColor("Yellow Green"));
135     addSprite(arc2);
136 
137     //making string sprite
138     StringSprite top;
139     top = new StringSprite("MinKim");
140     top.setSize(.2);
141     top.topJustify();
142     top.setLocation(0.50.1);
143     top.setColor(Palette.getColor("grey"));
144     addSprite(top);
145 
146     //making string sprite
147     StringSprite bottom;
148     bottom = new StringSprite("2008");
149     bottom.setSize(.2);
150     bottom.bottomJustify();
151     bottom.setLocation(0.50.9);
152     bottom.setColor(Palette.getColor("grey"));
153     addSprite(bottom);
154 
155     //inserting image
156     ImageSprite car;
157     car = new ImageSprite("Car123.jpg");
158     car.setSize(.2);
159     car.setLocation(0.10.7);
160     addSprite(car);
161 
162     //inserting image
163     ImageSprite car2;
164     car2 = new ImageSprite("Car144.jpg");
165     car2.setSize(.1);
166     car2.setLocation(0.90.7);
167     addSprite(car2);
168   }
169 
170   /**handle input and game events*/
171   public void advance()
172   {}
173 }


Download/View Min/SpriteMosaic.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