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 wiki.Wiki;
04 importimport means to make the classes and/or packages available in this program fang.*;
05 importimport means to make the classes and/or packages available in this program java.awt.*;
06 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
07
08 /**
09 * All about my game here.
10 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
11 */
12 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 HelloGameMod extendsextends means to customize or extend the functionality of a class GameLoop
13 {open braces start code blocks and must be matched with a close brace
14 privateprivate is used to restrict access to the current class only Sprite hello;
15 privateprivate is used to restrict access to the current class only Sprite eye;
16
17 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
18 {open braces start code blocks and must be matched with a close brace
19 hello=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
20 hello.setLocation(0.5, 0.5);
21 canvas.addSprite(hello);
22
23 hello=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
24 hello.setScale(0.1);
25 hello.setColor(Color.WHITE);
26 hello.setLocation(0.25, 0.25);
27 canvas.addSprite(hello);
28 }close braces end code blocks and must match an earlier open brace
29 }close braces end code blocks and must match an earlier open brace
|
Download/View Jam/HelloGameMod.java