|
001 packagepackage is used to name the directory or folder a class is in Chanelle;
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.Rectangle;
006
007
008 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 MyArt extendsextends means to customize or extend the functionality of a class Game
009 {open braces start code blocks and must be matched with a close brace
010 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
011 {open braces start code blocks and must be matched with a close brace
012
013 OvalSprite oval=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 0.3);
014 oval.setLocation(0.5, 0.2);
015 oval.setColor(Color.PINK);
016 addSprite(oval);
017
018 OvalSprite oval2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(0.7, 0.7);
019 oval2.setLocation(0.5, 0.5);
020 oval2.setColor(Color.WHITE);
021 addSprite(oval2);
022
023 PolygonSprite eye1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(5);
024 eye1.setScale(0.25);
025 eye1.setLocation(0.25, 0.35);
026 eye1.setColor(Palette.getColor("Navy"));
027 addSprite(eye1);
028
029 PolygonSprite eye2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(5);
030 eye2.setScale(0.25);
031 eye2.setLocation(0.75, 0.35);
032 eye2.setColor(Palette.getColor("Medium Blue"));
033 addSprite(eye2);
034
035 PolygonSprite nose=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(3);
036 nose.setScale(0.1);
037 nose.setLocation(0.5, 0.5);
038 nose.setColor(Palette.getColor("Teal"));
039 addSprite(nose);
040
041 PolygonSprite mark=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(7);
042 mark.setScale(0.05);
043 mark.setLocation(.30, .7);
044 mark.setColor(Palette.getColor("Teal"));
045 addSprite(mark);
046
047 PolygonSprite mouth=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(4);
048 mouth.setScale(0.20);
049 mouth.setLocation(.50, .70);
050 mouth.setColor(Color.PINK);
051 addSprite(mouth);
052
053 ImageSprite image1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Fangengine2.png");
054 image1.setSize(.12);
055 image1.setLocation(0.7, 0.6);
056 addSprite(image1);
057
058 ImageSprite image2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite("Java.jpg");
059 image2.setSize(.12);
060 image2.setLocation(0.9, 0.9);
061 addSprite(image2);
062
063 ArcSprite ball=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(1, 1, 10, 300);
064 ball.setSize(0.14);
065 ball.setLocation(0.3, 0.1);
066 ball.setColor(Palette.getColor("Teal"));
067 addSprite(ball);
068
069 ArcSprite j=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArcSprite(1, 1, 90, 270);
070 j.setSize(0.11);
071 j.setLocation(0.8, 0.9);
072 j.setColor(Palette.getColor("Teal"));
073 addSprite(j);
074
075 PieSprite pupil1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(1, 2, 35, 270);
076 pupil1.setSize(0.10);
077 pupil1.setLocation(0.25, 0.35);
078 pupil1.setColor(Color.BLACK);
079 addSprite(pupil1);
080
081 PieSprite pupil2=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, 300);
082 pupil2.setSize(0.10);
083 pupil2.setLocation(0.75, 0.35);
084 pupil2.setColor(Color.BLACK);
085 addSprite(pupil2);
086
087 LineSprite mouth1=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(1,1,0,0);
088 mouth1.setSize(0.13);
089 mouth1.setLocation(0.50, 0.70);
090 mouth1.setColor(Color.BLACK);
091 addSprite(mouth1);
092
093 LineSprite line=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor LineSprite(3,3,1,1);
094 line.setSize(0.16);
095 line.setLocation(0.3, 0.1);
096 line.setLineThickness(.1);
097 line.setColor(Color.BLACK);
098 addSprite(line);
099
100 StringSprite title=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("My Mosaic");
101 title.setSize(0.25);
102 title.setLocation(0.5, 0.10);
103 title.setColor(Color.WHITE);
104 addSprite(title);
105
106 StringSprite artist=this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor StringSprite("Chanelle Boscarino");
107 artist.setSize(0.30);
108 artist.setLocation(0.5, 0.9);
109 artist.setColor(Color.WHITE);
110 addSprite(artist);
111
112 RectangleSprite r=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor RectangleSprite(5, 1);
113 r.setSize(0.15);
114 r.setLocation(0.5, 0.3);
115 r.setColor(Color.BLACK);
116 addSprite(r);
117
118 }close braces end code blocks and must match an earlier open brace
119 }close braces end code blocks and must match an earlier open brace
|