john mcclarty/SpriteMosaic

From ggc

Jump to: navigation, search

001 package john_mcclarty;
002 
003 import wiki.Wiki;
004 import fang.*;
005 import java.awt.*;
006 import java.awt.geom.*;
007 
008 /**
009  * Ugly face
010  @author John McClarty
011  */
012 public class SpriteMosaic extends Game
013 {
014   /**sets up the game*/
015   public void setup()
016   {
017     //PieSprite - johnpie1
018     PieSprite johnpie1=new PieSprite(2260180);
019     johnpie1.setColor(Palette.getColor("RED"));
020     johnpie1.setSize(0.3);
021     johnpie1.setLocation(0.250.45);
022     addSprite(johnpie1);
023 
024     //PieSprite - johnpie2
025     PieSprite johnpie2=new PieSprite(2,2,240,360);
026     johnpie2.setColor(Palette.getColor("Red"));
027     johnpie2.setSize(0.3);
028     johnpie2.setLocation(0.75,0.47);
029     addSprite(johnpie2);
030 
031     //Triangle - johntriangle
032     PolygonSprite johntriangle=new PolygonSprite(3);
033     johntriangle.setSize(0.2);
034     johntriangle.setLocation(0.5,0.6);
035     johntriangle.setColor(Palette.getColor("Dark Olive Green"));
036     addSprite(johntriangle);
037 
038     //Wolf image
039     ImageSprite Wolfpic=new ImageSprite ("Gray_wolf.jpg");
040     Wolfpic.setSize(0.35);
041     Wolfpic.setLocation(0.9,0.85);
042     addSprite(Wolfpic);
043 
044     //Line sprites
045     LineSprite line1;
046     line1=new LineSprite(0,0,1,1);
047     line1.setSize(0.25);
048     line1.setLocation(0.340.28);
049     line1.setColor(Palette.getColor("Yellow"));
050     addSprite(line1);
051 
052     LineSprite thickline;
053     thickline=new LineSprite(1,0,0,1);
054     thickline.setSize(0.25);
055     thickline.setLocation(0.66,0.28);
056     thickline.setColor(Palette.getColor("Green"));
057     thickline.setLineThickness(0.1);
058     addSprite(thickline);
059 
060     //Add circle
061     OvalSprite circlej;
062     circlej=new OvalSprite(1,1);
063     circlej.setSize(0.1);
064     circlej.setLocation(0.25,0.45);
065     circlej.setColor(Palette.getColor("Cornflower Blue"));
066     addSprite(circlej);
067 
068     //Add oval
069     OvalSprite ovalj;
070     ovalj=new OvalSprite(0.75,0.25);
071     ovalj.setSize(0.35);
072     ovalj.setLocation(0.5,0.85);
073     ovalj.setColor(Palette.getColor("Crimson"));
074     addSprite(ovalj);
075 
076     //Add Pentagon
077     PolygonSprite pentaj;
078     pentaj=new PolygonSprite(5);
079     pentaj.setSize(0.1);
080     pentaj.setLocation(0.75,0.45);
081     pentaj.setColor(Palette.getColor("Cornflower Blue"));
082     addSprite(pentaj);
083 
084     //Add Custom Polygon
085     PolygonSprite customj;
086     customj=new PolygonSprite(3,6,1,5,4,0);
087     customj.setSize(0.15);
088     customj.setLocation(0.6,0.75);
089     customj.setColor(Palette.getColor("Ivory"));
090     addSprite(customj);
091 
092     PolygonSprite custom2;
093     custom2=new PolygonSprite(6,0,1,3,8,8,12,5);
094     custom2.setSize(0.15);
095     custom2.setLocation(0.4,0.78);
096     custom2.setColor(Palette.getColor("Ivory"));
097     addSprite(custom2);
098 
099     //Add Rectangles
100     RectangleSprite squarej;
101     squarej=new RectangleSprite(0.5,0.5);
102     squarej.setSize(0.2);
103     squarej.setLocation(0.5,0.2);
104     squarej.setColor(Palette.getColor("Lime Green"));
105     addSprite(squarej);
106 
107     RectangleSprite rectj;
108     rectj=new RectangleSprite(1,0.375);
109     rectj.setSize(0.3);
110     rectj.setLocation(0.5,0.2);
111     rectj.setColor(Palette.getColor("Maroon"));
112     addSprite(rectj);
113 
114     //Add Arc Sprites
115     ArcSprite arc1;
116     arc1=new ArcSprite(2,3,45,150);
117     arc1.setSize(0.2);
118     arc1.setLocation(0.25,0.32);
119     arc1.setColor(Palette.getColor("Chartreuse"));
120     addSprite(arc1);
121 
122     ArcSprite arc2;
123     arc2=new ArcSprite(2,3,225,330);
124     arc2.setSize(0.2);
125     arc2.setLocation(0.8,0.3);
126     arc2.setColor(Palette.getColor("Chartreuse"));
127     addSprite(arc2);
128 
129     //Duke image
130     ImageSprite AuronFF10=new ImageSprite ("Duke-Color-Logo.jpg");
131     AuronFF10.setSize(0.3);
132     AuronFF10.setLocation(0.1,0.14);
133     addSprite(AuronFF10);
134 
135 
136     //Author string
137     StringSprite name;
138     name=new StringSprite("John McClarty");
139     name.setSize(0.35);
140     name.setLocation(0.5,0.95);
141     name.bottomJustify();
142     name.setColor(Palette.getColor("Blue"));
143     addSprite(name);
144 
145     //Title string
146     StringSprite title;
147     title=new StringSprite("Game Face");
148     title.setSize(0.35);
149     title.setLocation(0.5,0.05);
150     title.topJustify();
151     title.setColor(Palette.getColor("Blue"));
152     addSprite(title);
153 
154 
155 
156   }
157 }


Download/View john_mcclarty/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