From ggc
|
01 packagepackage is used to name the directory or folder a class is in jam;
02
03 importimport means to make the classes and/or packages available in this program fang.*;
04 importimport means to make the classes and/or packages available in this program java.awt.*;
05 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
06
07 /**
08 * All about my game.
09 * @authorthis is the Javadoc tag for documenting who created the source code My Name Here
10 */
11 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
12 {open braces start code blocks and must be matched with a close brace
13 /**sets up the game*/
14 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
15 {open braces start code blocks and must be matched with a close brace
16 PieSprite pie=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(.5, .125, 45, 180);
17 //pie.setSize(0.25);
18 pie.setLocation(0.5, 0.7);
19 pie.setColor(Palette.getColor("Midnight Blue"));
20 addSprite(pie);
21
22 PieSprite pie2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PieSprite(1, 0.5, 45, 180);
23 pie2.setSize(0.5);
24 pie2.setLocation(0.7, 0.7);
25 pie2.setColor(Palette.getColor("Midnight Blue"));
26 addSprite(pie2);
27
28 PolygonSprite poly=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor PolygonSprite(
29 0.0, 0.0,
30 1.0, 0.0,
31 0.0, 1.0);
32 poly.setLocation(0.5, 0.5);
33 addSprite(poly);
34 }close braces end code blocks and must match an earlier open brace
35
36 /**handle input and game events*/
37 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value advance()
38 {open braces start code blocks and must be matched with a close brace}close braces end code blocks and must match an earlier open brace
39 }close braces end code blocks and must match an earlier open brace
|
Download/View jam/SpriteMosaic.java