Danielle/SpriteMosaic

From ggc

Jump to: navigation, search

001 package Danielle;
002 
003 import fang.*;
004 import java.awt.*;
005 import java.awt.geom.*;
006 import java.awt.Color;
007 
008 /**
009  * All about my game.
010  @author Danielle Kyser
011  */
012 public class SpriteMosaic extends Game
013 {
014   /**sets up the game*/
015   public void setup()
016   {
017     //Fish
018     ImageSprite Fish;
019     Fish=new ImageSprite("Parrot-fish.jpg");
020     Fish.setSize(0.38);
021     Fish.setLocation(0.15,0.88);
022     addSprite(Fish);
023 
024     //green oval
025     OvalSprite goval;
026     goval=new OvalSprite (2,2);
027     goval.setSize(0.15);
028     goval.setLocation(0.4,0.1);
029     goval.setColor(Palette.getColor("Green"));
030     addSprite(goval);
031 
032     //blue oval
033     OvalSprite boval;
034     boval=new OvalSprite (3,2);
035     boval.setSize(0.15);
036     boval.setLocation(0.9,0.5);
037     boval.setColor(Palette.getColor("Blue"));
038     addSprite(boval);
039 
040     //title
041     StringSprite thread;
042     thread=new StringSprite ("Aquarium");
043     thread.setSize(0.8);
044     thread.topJustify();
045     thread.setLocation(0.5,0.1);
046     thread.setColor(Palette.getColor("Pink"));
047     addSprite(thread);
048 
049     //title2
050     StringSprite thread2;
051     thread2=new StringSprite ("Danielle");
052     thread2.setSize(0.25);
053     thread2.bottomJustify();
054     thread2.setLocation(0.5,1);
055     thread2.setColor(Palette.getColor("Silver"));
056     addSprite(thread2);
057 
058     //shark
059     ImageSprite shark;
060     shark=new ImageSprite("Shark.jpg");
061     shark.setSize(0.30);
062     shark.setLocation(0.10,0.60);
063     addSprite(shark);
064 
065     //thick line
066     LineSprite line1;
067     line1=new LineSprite (3,3,7,7);
068     line1.setSize(40);
069     line1.setLocation(.41,.57);
070     line1.setColor(Palette.getColor("Orange"));
071     addSprite(line1);
072 
073     //thin line
074     LineSprite line2;
075     line2=new LineSprite (1,3,5,7);
076     line2.setSize(.35);
077     line2.setLineThickness (0.25);
078     line2.setLocation(.60,.70);
079     line2.setColor(Palette.getColor("Purple"));
080     addSprite(line2);
081 
082     //square
083     RectangleSprite square1;
084     square1=new RectangleSprite(3,2);
085     square1.setSize(0.15);
086     square1.setLocation(0.7,0.3);
087     square1.setColor(Palette.getColor("Magenta"));
088     addSprite(square1);
089 
090     //rectangle
091     RectangleSprite square2;
092     square2=new RectangleSprite(5,1);
093     square2.setSize(0.15);
094     square2.setLocation(0.8,0.4);
095     square2.setColor(Palette.getColor("Aqua"));
096     addSprite(square2);
097 
098     //pie
099     PieSprite pie1;
100     pie1=new PieSprite(1,1,210,120);
101     pie1.setSize(0.35);
102     pie1.setLocation(0.3,0.4);
103     pie1.setColor(Palette.getColor("Red"));
104     addSprite(pie1);
105 
106     //little pie
107     PieSprite pie2;
108     pie2=new PieSprite(1,1,45,350);
109     pie2.setSize(0.15);
110     pie2.setLocation(0.4,0.8);
111     pie2.setColor(Palette.getColor("Lime"));
112     addSprite(pie2);
113 
114     //arc
115     ArcSprite arc1;
116     arc1=new ArcSprite(1,1,120,230);
117     arc1.setSize(0.15);
118     arc1.setLocation(0.8,0.8);
119     arc1.setColor(Palette.getColor("Hot Pink"));
120     addSprite(arc1);
121 
122 
123     //arc mini
124     ArcSprite arc2;
125     arc2=new ArcSprite(1,1,-50,65);
126     arc2.setSize(0.10);
127     arc2.setLocation(0.9,0.9);
128     arc2.setColor(Palette.getColor("Yellow"));
129     addSprite(arc2);
130 
131     //polygon
132     PolygonSprite poly1;
133     poly1=new PolygonSprite(8);
134     poly1.setSize(0.05);
135     poly1.setLocation(0.5,0.8);
136     poly1.setColor(Palette.getColor("Beige"));
137     addSprite(poly1);
138 
139     //triangle
140     PolygonSprite poly2;
141     poly2=new PolygonSprite(3);
142     poly2.setSize(0.10);
143     poly2.setLocation(0.8,0.6);
144     poly2.setColor(Palette.getColor("Spring Green"));
145     addSprite(poly2);
146 
147     //big polygon
148     PolygonSprite poly3;
149     poly3=new PolygonSprite(3,5,4,6,7,8,4,2);
150     poly3.setSize(0.40);
151     poly3.setLocation(0.6,0.5);
152     poly3.setColor(Palette.getColor("Teal"));
153     addSprite(poly3);
154 
155     //new polygon
156     PolygonSprite poly4;
157     poly4=new PolygonSprite(2,4,8,7,6,4,5,3);
158     poly4.setSize(0.10);
159     poly4.setLocation(0.5,0.5);
160     poly4.setColor(Palette.getColor("Gold"));
161     addSprite(poly4);
162 
163   }
164 
165   /**handle input and game events*/
166   public void advance()
167   {}
168 }


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