|
001 packagepackage is used to name the directory or folder a class is in wilson;
002
003 importimport means to make the classes and/or packages available in this program java.util.*;
004 importimport means to make the classes and/or packages available in this program wiki.Wiki;
005 importimport means to make the classes and/or packages available in this program fang.*;
006 importimport means to make the classes and/or packages available in this program java.awt.*;
007 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
008
009 /**
010 * All about my game here.
011 * @authorthis is the Javadoc tag for documenting who created the source code Wilson Green
012 */
013 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
014 {open braces start code blocks and must be matched with a close brace
015 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
016 {open braces start code blocks and must be matched with a close brace
017 OvalSprite head=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(2,1);
018 head.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
019 head.setSize(.5);
020 head.setLocation(.5,.25);
021 addSprite(head);
022
023 OvalSprite eye1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1,1);
024 eye1.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
025 eye1.setSize(.05);
026 eye1.setLocation(.40,.2);
027 addSprite(eye1);
028
029 OvalSprite eye2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1,1);
030 eye2.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
031 eye2.setSize(.05);
032 eye2.setLocation(.60,.2);
033 addSprite(eye2);
034
035 RectangleSprite rpupil=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(5,5);
036 rpupil.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
037 rpupil.setSize(.01);
038 rpupil.setLocation(.4,.2);
039 addSprite(rpupil);
040
041 RectangleSprite lpupil=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(5,5);
042 lpupil.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
043 lpupil.setSize(.01);
044 lpupil.setLocation(.6,.2);
045 addSprite(lpupil);
046
047 PieSprite ear=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(1,1,90,270);
048 ear.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
049 ear.setSize(.1);
050 ear.setLocation(.1,.2);
051 addSprite(ear);
052
053 PieSprite mouth=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(1,1,180,360);
054 mouth.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
055 mouth.setSize(.15);
056 mouth.setLocation(.5,.3);
057 addSprite(mouth);
058
059 RectangleSprite neck=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(5,25);
060 neck.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
061 neck.setSize(.3);
062 neck.setLocation(.5,.52);
063 addSprite(neck);
064
065 RectangleSprite larm=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(25,5);
066 larm.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
067 larm.setSize(.2);
068 larm.setLocation(.45,.45);
069 addSprite(larm);
070
071 RectangleSprite rarm=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(25,5);
072 rarm.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
073 rarm.setSize(.2);
074 rarm.setLocation(.55,.45);
075 addSprite(rarm);
076
077 RectangleSprite lleg=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(25,5);
078 lleg.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
079 lleg.setSize(.2);
080 lleg.setLocation(.45,.75);
081 addSprite(lleg);
082
083 RectangleSprite rleg=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(25,5);
084 rleg.setColor(newnew is used to create objects by calling the constructor Color(50,50,50));
085 rleg.setSize(.2);
086 rleg.setLocation(.55,.75);
087 addSprite(rleg);
088
089 larm.rotateDegrees(110);
090 rarm.rotateDegrees(80);
091 lleg.rotateDegrees(120);
092 rleg.rotateDegrees(60);
093
094 StringSprite name=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("By: Wilson Green");
095 name.setSize(.3);
096 name.setLocation(.5,.9);
097 addSprite(name);
098
099 StringSprite title=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Sprite Stick Figure!");
100 title.leftJustify();
101 title.topJustify();
102 title.setSize(.3);
103 title.setLocation(.1,.05);
104 addSprite(title);
105
106
107 LineSprite hair=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(0,0,8,8);
108 hair.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
109 hair.setSize(.15);
110 hair.setLocation(.6,.1);
111 addSprite(hair);
112
113
114 LineSprite hair2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(0,0,2,2);
115 hair2.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
116 hair2.setSize(.15);
117 hair2.setLocation(.6,.2);
118 addSprite(hair2);
119
120 ArcSprite lhand=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(1,1,180,360);
121 lhand.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
122 lhand.setSize(.1);
123 lhand.setLocation(.4,.55);
124 addSprite(lhand);
125
126 ArcSprite rhand=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(1,1,200,300);
127 rhand.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
128 rhand.setSize(.1);
129 rhand.setLocation(.6,.55);
130 addSprite(rhand);
131
132 PolygonSprite belt=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(3);
133 belt.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
134 belt.setSize(.1);
135 belt.setLocation(.5,.6);
136 addSprite(belt);
137
138 PolygonSprite rshoe=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(6);
139 rshoe.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
140 rshoe.setSize(.1);
141 rshoe.setLocation(.6,.8);
142 addSprite(rshoe);
143
144 PolygonSprite lshoe=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(6);
145 lshoe.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
146 lshoe.setSize(.1);
147 lshoe.setLocation(.4,.8);
148 addSprite(lshoe);
149
150 PolygonSprite tie=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(10);
151 tie.setColor(newnew is used to create objects by calling the constructor Color(255,255,255));
152 tie.setSize(.08);
153 tie.setLocation(.5,.4);
154 addSprite(tie);
155
156 ImageSprite sun=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Sun.gif");
157 sun.setSize(.15);
158 sun.setLocation(.8,.1);
159 addSprite(sun);
160
161
162 ImageSprite sword=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Sword.png");
163 sword.setSize(.15);
164 sword.setLocation(.3,.5);
165 addSprite(sword);
166 }close braces end code blocks and must match an earlier open brace
167 }close braces end code blocks and must match an earlier open brace
|