|
001 importimport means to make the classes and/or packages available in this program fang.*;
002 importimport means to make the classes and/or packages available in this program java.awt.*;
003 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
004
005 /**
006 * All about my game here.
007 * @authorthis is the Javadoc tag for documenting who created the source code Anam Mughal
008 */
009 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 AnamsweirdArt extendsextends means to customize or extend the functionality of a class Game
010 {open braces start code blocks and must be matched with a close brace
011 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
012 {open braces start code blocks and must be matched with a close brace
013 PolygonSprite Polygon=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(1, 0, 2, 2, 1, 1, 0, 1);
014 Polygon.setColor(Palette.getColor("Sandy Brown"));
015 Polygon.setSize(0.30);
016 Polygon.setLocation(.17, .21);
017 addSprite(Polygon);
018
019 OvalSprite even=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(0.5, 0.5);
020 even.setColor(Palette.getColor("Light Blue"));
021 even.setSize(0.15);
022 even.setLocation(.40, .15);
023 addSprite(even);
024
025 OvalSprite odd=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(0.7, .15);
026 odd.setColor(Color.YELLOW);
027 odd.setSize(.40);
028 odd.setLocation(0.70, .16);
029 addSprite(odd);
030
031 PolygonSprite mine=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(6);
032 mine.setColor(Color.GREEN);
033 mine.setSize(0.10);
034 mine.setLocation(0.07, .15);
035 addSprite(mine);
036
037 PolygonSprite weird=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(1, 2, 5, 5, 3, 4, 2, 1, 3, 3);
038 weird.setColor(Color.RED);
039 weird.setSize(0.23);
040 weird.setLocation(0.20, .40);
041 addSprite(weird);
042
043 PolygonSprite shapy=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(8);
044 shapy.setColor(getColor(30, 55, 45));
045 shapy.setSize(0.26);
046 shapy.setLocation(0.45, 0.55);
047 addSprite(shapy);
048
049 LineSprite skinny=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(0, 0, 1, 1);
050 skinny.setColor(Color.BLUE);
051 skinny.setSize(0.20);
052 skinny.setLineThickness(.03);
053 skinny.setLocation(0.70, 0.16);
054 addSprite(skinny);
055
056 LineSprite fatty=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(1, 1, 2, 2);
057 fatty.setColor(Palette.getColor("Dark Red"));
058 fatty.setSize(0.15);
059 fatty.setLineThickness(0.10);
060 fatty.setLocation(0.40, 0.15);
061 addSprite(fatty);
062
063 PieSprite party=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(2, 2, 65, 190);
064 party.setColor(Color.PINK);
065 party.setSize(0.10);
066 party.setLocation(0.40, 0.35);
067 addSprite(party);
068
069 PieSprite party2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(3, 4, 120, 355);
070 party2.setColor(Palette.getColor("Olive"));
071 party2.setSize(0.16);
072 party2.setLocation(0.60, 0.35);
073 addSprite(party2);
074
075 ArcSprite halfy=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(5, 6, 48, 175);
076 halfy.setColor(getColor(105, 55, 100));
077 halfy.setSize(0.18);
078 halfy.setLocation(0.78, 0.34);
079
080
081 ArcSprite halfy2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite (8, 10, 55, 280);
082 halfy2.setColor(Palette.getColor("Silver"));
083 halfy2.setSize(0.20);
084 halfy2.setLocation(0.85, 0.38);
085 addSprite(halfy2);
086 addSprite(halfy);
087
088 ImageSprite bell=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Belle.jpg");
089 bell.setSize(0.22);
090 bell.setLocation(0.15, 0.83);
091 addSprite(bell);
092
093 ImageSprite choc=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor ImageSprite("Choco.jpg");
094 choc.setSize(0.25);
095 choc.setLocation(0.85, 0.83);
096 addSprite(choc);
097
098 RectangleSprite box=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite(0.5, 0.5);
099 box.setColor(Palette.getColor("Lime Green"));
100 box.setSize(0.18);
101 box.setLocation(0.75, 0.60);
102 addSprite(box);
103
104 RectangleSprite uneven=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(3, 1);
105 uneven.setColor(getColor(100, 45, 30));
106 uneven.setSize(0.30);
107 uneven.setLocation(0.50, 0.85);
108 addSprite(uneven);
109
110 StringSprite name=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Senseless Art");
111 name.setSize(0.50);
112 name.setLocation(0.50, 0.01);
113 name.topJustify();
114 name.setColor(Palette.getColor("Salmon"));
115 addSprite(name);
116
117 StringSprite myname=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Anam Mughal");
118 myname.setSize(0.40);
119 myname.setLocation(0.50, 0.99);
120 myname.bottomJustify();
121 myname.setColor(Palette.getColor("Peachpuff"));
122 addSprite(myname);
123
124
125
126
127
128
129
130
131 }close braces end code blocks and must match an earlier open brace
132 }close braces end code blocks and must match an earlier open brace
|