joseph/SpriteMosaic

From ggc

Jump to: navigation, search

001 package joseph;
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 My Name Here
011  */
012 public class SpriteMosaic extends Game
013 {
014   /**sets up the game*/
015   public void setup()
016   {
017     //Image of Atlanta
018     ImageSprite Atlanta;
019     Atlanta=new ImageSprite("Atlanta.jpg");
020     Atlanta.setSize(0.38);
021     Atlanta.setLocation(0.15,0.88);
022     addSprite(Atlanta);
023 
024     //PieSprite - pacman
025     PieSprite pacman;
026     pacman=new PieSprite (1,1,45,360);
027     pacman.setSize (0.75);
028     pacman.setLocation(0.5,0.5);
029     pacman.setColor(Palette.getColor("Yellow"));
030     addSprite(pacman);
031 
032     //rectangle
033     RectangleSprite specialsquare;
034     specialsquare=new RectangleSprite(1,1);
035     specialsquare.setSize(.25);
036     specialsquare.setLocation(0.9,0.7);
037     specialsquare.setColor(Palette.getColor("Lime"));
038     addSprite(specialsquare);
039 
040     //square
041     RectangleSprite square;
042     square=new RectangleSprite(5,1);
043     square.setSize(.25);
044     square.setLocation(0.82,0.7);
045     square.setColor(Palette.getColor("Dark Slate Blue"));
046     addSprite(square);
047 
048     //Thick Line Sprite
049     LineSprite biggy;
050     biggy=new LineSprite(3,3,7,7);
051     biggy.setSize(40);
052     biggy.setLocation(.41,.57);
053     biggy.setColor(Palette.getColor("Red"));
054     addSprite(biggy);
055 
056     //Thin Line Sprite
057     LineSprite tiny;
058     tiny=new LineSprite(1,3,4,5);
059     tiny.setSize(.35);
060     tiny.setLineThickness (0.74);
061     tiny.setLocation(.50,.70);
062     tiny.setColor(Palette.getColor("Black"));
063     addSprite(tiny);
064 
065     //PieSprite - mini pacman
066     PieSprite mini;
067     mini=new PieSprite (1,1,210,120);
068     mini.setSize (0.35);
069     mini.setLocation(0.4,0.5);
070     mini.setColor(Palette.getColor("Black"));
071     addSprite(mini);
072 
073     //Image of the Atlanta Falcons logo
074     ImageSprite AtlantaFalcons;
075     AtlantaFalcons=new ImageSprite("AtlantaFalcons.png");
076     AtlantaFalcons.setSize(0.19);
077     AtlantaFalcons.setLocation(0.12,0.5);
078     addSprite(AtlantaFalcons);
079 
080     //Eyes of Pacman
081     OvalSprite eyes;
082     eyes=new OvalSprite(1,1);
083     eyes.setSize(0.15);
084     eyes.setLocation(0.5,0.3);
085     eyes.setColor(Palette.getColor("Silver"));
086     addSprite(eyes);
087 
088     //Polygon1
089     PolygonSprite brown;
090     brown=new PolygonSprite(6);
091     brown.setSize(0.09);
092     brown.setLocation(0.9,0.3);
093     brown.setColor(Palette.getColor("Brown"));
094     addSprite(brown);
095 
096     //Polygon2
097     PolygonSprite DarkCyan;
098     DarkCyan=new PolygonSprite(6);
099     DarkCyan.setSize(0.16);
100     DarkCyan.setLocation(0.15,0.17);
101     DarkCyan.setColor(Palette.getColor("Dark Cyan"));
102     addSprite(DarkCyan);
103 
104     //Custom Polygon1 (Triangle)
105     PolygonSprite Triangle;
106     Triangle=new PolygonSprite(3);
107     Triangle.setSize(0.16);
108     Triangle.setLocation(0.5,0.1);
109     Triangle.setColor(Palette.getColor("Fire Brick"));
110     addSprite(Triangle);
111 
112     //Custom Polygon2 (Octagon)
113     PolygonSprite Octagon;
114     Octagon=new PolygonSprite(8);
115     Octagon.setSize(0.11);
116     Octagon.setLocation(0.8,0.37);
117     Octagon.setColor(Palette.getColor("Dark Orange"));
118     addSprite(Octagon);
119 
120     //Text above stating Pac-Man's Birthday'
121     StringSprite Birthday;
122     Birthday=new StringSprite("Pac-Man's Birthday");
123     Birthday.setSize(0.9);
124     Birthday.setLocation(0.5,0.02);
125     Birthday.topJustify();
126     Birthday.setColor(Palette.getColor("White"));
127     addSprite(Birthday);
128 
129     //Text below stating the Author's name
130     StringSprite JPAI;
131     JPAI=new StringSprite("Joseph Argumedo");
132     JPAI.setSize(0.3);
133     JPAI.setLocation(0.5,1);
134     JPAI.bottomJustify();
135     JPAI.setColor(Palette.getColor("White"));
136     addSprite(JPAI);
137 
138     //Oblong
139     OvalSprite QUESTION;
140     QUESTION=new OvalSprite(5,1);
141     QUESTION.setSize(0.22);
142     QUESTION.setLocation(0.5,0.9);
143     QUESTION.setColor(Palette.getColor("Dark Green"));
144     addSprite(QUESTION);
145 
146 
147   }
148 
149   /**handle input and game events*/
150   public void advance()
151   {}
152 }


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