From ggc
|
01 packagepackage is used to name the directory or folder a class is in intro;
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 * @authornull 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 GeneralMovement 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 privateprivate is used to restrict access to the current class only Sprite oval;
14
15 /**sets up the game*/
16 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setup()
17 {open braces start code blocks and must be matched with a close brace
18 oval=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(0.1, 0.1);
19
20 OutlineTransformer transformer;
21 transformer=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OutlineTransformer(0.25,
22 0.1, 0.1,
23 0.5, 0.8,
24 0.8, 0.5,
25 0.1, 0.1);
26 transformer.setLooping(truetrue is the boolean value that is the opposite of false);
27
28 oval.addTransformer(transformer);
29 oval.setLocation(transformer.getCurrentPoint());
30 addSprite(oval);
31 }close braces end code blocks and must match an earlier open brace
32
33 }close braces end code blocks and must match an earlier open brace
|
Download/View intro/GeneralMovement.java