Rohrer/Sprite Mosaic

From ggc

Jump to: navigation, search

001 package Rohrer;
002 
003 import fang.*;
004 import java.awt.*;
005 import java.awt.geom.*;
006 
007 /**
008  * Assignment 3 
009  @author Kevin Rohrer
010  */
011 public class Sprite_Mosaic extends Game
012 {
013 
014   /**sets up the game*/
015   public void setup()
016   {
017 
018     OvalSprite oval1= new OvalSprite(1,1);
019     oval1.setSize(.7);
020     oval1.setLocation(.5.55);
021     oval1.setColor(Palette.getColor("Orange Red"));
022 
023     OvalSprite oval2= new OvalSprite(31);
024     oval2.setSize(.35);
025     oval2.setLocation(.5,.1);
026     oval2.setColor(Palette.getColor("Lawn Green"));
027 
028     StringSprite text1= new StringSprite("My Sprite Mosaic");
029     text1.setSize(.3);
030     text1.setLocation(.5,.08);
031     text1.topJustify();
032     text1.setColor(Palette.getColor("Black"));
033 
034     StringSprite text2= new StringSprite("BY: Kevin Rohrer");
035     text2.setSize(.5);
036     text2.leftJustify();
037     text2.bottomJustify();
038     text2.setLocation(0,1);
039     text2.setColor(Palette.getColor("White"));
040 
041     ImageSprite image1= new ImageSprite("Java.jpg");
042     image1.setLocation(.92,.93);
043     image1.setSize(.12);
044 
045     ImageSprite image2= new ImageSprite("Fangengine2.png");
046     image2.setLocation(.75,.93);
047     image2.setSize(.12);
048 
049     ArcSprite arc1= new ArcSprite(.3,.3,200,340);
050     arc1.setLocation(.5,.8);
051     arc1.setColor(Palette.getColor("Dark Blue"));
052 
053     ArcSprite arc2= new ArcSprite(.15,.15,220,340);
054     arc2.setLocation(.5,.8);
055     arc2.setColor(Palette.getColor("White"));
056 
057     PolygonSprite poly1= new PolygonSprite(6);
058     poly1.setLocation(.35,.4);
059     poly1.setSize(.2);
060     poly1.setColor(Palette.getColor("Dark Magenta"));
061 
062     PolygonSprite poly2= new PolygonSprite(8);
063     poly2.setLocation(.35,.4);
064     poly2.setSize(.07);
065     poly2.setColor(Palette.getColor("Yellow Green"));
066 
067     PolygonSprite poly3= new PolygonSprite(0,0,1,0,.7,.7,.3,.7);
068     poly3.setLocation(.65,.4);
069     poly3.setSize(.2);
070     poly3.setColor(Palette.getColor("Maroon"));
071 
072     PolygonSprite poly4= new PolygonSprite(0,0,1,0,.7,.7,.25,.8);
073     poly4.setLocation(.65,.4);
074     poly4.setSize(.07);
075     poly4.setColor(Palette.getColor("Lawn Green"));
076 
077     RectangleSprite box1= new RectangleSprite(1,1);
078     box1.setLocation(.12,.85);
079     box1.setSize(.15);
080     box1.setColor(Palette.getColor("Dark Green"));
081 
082     RectangleSprite box2= new RectangleSprite(1,2);
083     box2.setLocation(.5,.6);
084     box2.setSize(.1);
085     box2.setColor(Palette.getColor("Black"));
086 
087     LineSprite line1= new LineSprite(0,0,1,0);
088     line1.setLocation(.5,.1);
089     line1.setLineThickness(.02);
090     line1.setSize(1);
091     line1.setColor(Palette.getColor("Olive Drab"));
092 
093     LineSprite line2= new LineSprite(0,0,1,0);
094     line2.setLocation(.5,.3);
095     line2.setLineThickness(.03);
096     line2.setSize(.25);
097     line2.setColor(Palette.getColor("White"));
098 
099 
100     PieSprite pie1= new PieSprite(1,1,120,270);
101     pie1.setLocation(.09,.85);
102     pie1.setSize(.1);
103     pie1.setColor(Palette.getColor("Dark Goldenrod"));
104 
105     PieSprite pie2= new PieSprite(1,1,270,60);
106     pie2.setLocation(.15,.85);
107     pie2.setSize(.1);
108     pie2.setColor(Palette.getColor("Goldenrod"));
109 
110 
111 
112     addSprite(line1);
113     addSprite(oval1);
114     addSprite(oval2);
115     addSprite(text1);
116     addSprite(text2);
117     addSprite(image1);
118     addSprite(image2);
119     addSprite(arc1);
120     addSprite(arc2);
121     addSprite(poly1);
122     addSprite(poly2);
123     addSprite(poly3);
124     addSprite(poly4);
125     addSprite(box1);
126     addSprite(box2);
127     addSprite(pie1);
128     addSprite(pie2);
129     addSprite(line2);
130 
131 
132   }
133 
134 }


Download/View Rohrer/Sprite_Mosaic.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