|
001 packagepackage is used to name the directory or folder a class is in matthew;
002
003 importimport means to make the classes and/or packages available in this program fang.*;
004 importimport means to make the classes and/or packages available in this program java.awt.*;
005 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
006
007 /**
008 * All about my game.
009 * @authornull My Name Here
010 */
011 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects SpriteMosaic extendsextends means to customize or extend the functionality of a class Game
012 {open braces start code blocks and must be matched with a close brace
013
014
015 /**sets up the game*/
016 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
017 {open braces start code blocks and must be matched with a close brace
018 PieSprite pieman=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(3,4,80,150);
019 pieman.setColor(Palette.getColor("Orchid"));
020 pieman.setSize(.4);
021 pieman.setLocation(.25,.25);
022 addSprite(pieman);
023
024 PieSprite pieman2;
025 pieman2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite (1,1,45,360);
026 pieman2.setSize (0.20);
027 pieman2.setLocation(0.75,0.25);
028 addSprite(pieman2);
029
030
031 OvalSprite round;
032 round=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1,1);
033 round.setSize(0.1);
034 round.setLocation(0.25,0.2);
035 round.setColor(Palette.getColor("red"));
036 addSprite(round);
037
038 OvalSprite ovalmatt;
039 ovalmatt=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1,2);
040 ovalmatt.setSize(0.1);
041 ovalmatt.setLocation(0.75,0.25);
042 ovalmatt.setColor(Palette.getColor("YELLOW"));
043 addSprite(ovalmatt);
044
045
046 RectangleSprite square;
047 square=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(5,1);
048 square.setSize(.50);
049 square.setLocation(0.50,0.7);
050 square.setColor(Palette.getColor("Lime"));
051 addSprite(square);
052
053 LineSprite mean;
054 mean=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(4,4,8,8);
055 mean.setSize(15);
056 mean.setLocation(.30,.20);
057 mean.setColor(Palette.getColor("Midnight Blue"));
058 addSprite(mean);
059
060 ArcSprite arc1;
061 arc1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(2, 1, 180, 0);
062 arc1.setColor(Palette.getColor("ORANGE"));
063 arc1.setSize(0.50);
064 arc1.setLocation(0.5, 0.80);
065 addSprite(arc1);
066
067
068 PolygonSprite Oct;
069 Oct=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(8);
070 Oct.setSize(0.25);
071 Oct.setLocation(.50,.40);
072 addSprite(Oct);
073
074 ImageSprite image;
075 image=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Ssth.png");
076 image.setSize(.20);
077 image.setLocation(.1,.9);
078 addSprite(image);
079
080
081 ImageSprite image2;
082 image2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Sonic.png");
083 image2.setSize(.20);
084 image2.setLocation(.9,.9);
085 addSprite(image2);
086
087 ArcSprite arc2;
088 arc2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite (1, 1, 75, 220);
089 arc2.setSize(0.15);
090 arc2.setLocation(0.5, 0.4);
091 arc2.setColor(Palette.getColor("Red"));
092 addSprite(arc2);
093
094 StringSprite happy;
095 happy=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Happy Face");
096 happy.setSize(0.30);
097 happy.topJustify();
098 happy.setLocation(0.5, 0.05);
099 addSprite(happy);
100
101 LineSprite line;
102 line=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(2, 2, 1, 1);
103 line.setSize(0.15);
104 line.setLocation(0.6, 0.8);
105 line.setColor(Palette.getColor("pink"));
106 addSprite(line);
107
108 StringSprite name;
109 name=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("matthew mitrovich and kcie green");
110 name.setSize(0.50);
111 name.bottomJustify();
112 name.setLocation(0.5, 0.99);
113 addSprite(name);
114
115 RectangleSprite rectangle;
116 rectangle=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(1,1);
117 rectangle.setSize(.15);
118 rectangle.setLocation(.1,.1);
119 rectangle.setColor(Palette.getColor("orange"));
120 addSprite(rectangle);
121
122 PolygonSprite polygon;
123 polygon=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(5);
124 polygon.setSize(0.15);
125 polygon.setLocation(0.85, 0.7);
126 polygon.setColor(Palette.getColor("white"));
127 addSprite(polygon);
128
129 PolygonSprite cool=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(.6,.7,.6,.8,.1,.6,.7,.8);
130 cool.setColor(newnew is used to create objects by calling the constructor Color(189,99,15));
131 cool.setSize(.5);
132 cool.setLocation(.5,.75);
133 addSprite(cool);
134
135 PolygonSprite angle=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(1.5,1.5,.9,.6,.5,.5);
136 angle.setColor(newnew is used to create objects by calling the constructor Color(189,99,50));
137 angle.setSize(.25);
138 angle.setLocation(.65,.5);
139 addSprite(angle);
140
141
142
143
144
145
146
147
148
149
150
151
152 }close braces end code blocks and must match an earlier open brace
153 }close braces end code blocks and must match an earlier open brace
|