From ggc
|
01 packagepackage is used to name the directory or folder a class is in Jam;
02 importimport means to make the classes and/or packages available in this program fang.*;
03 /**
04 * All about my classclass is a group of fields and methods used for making objects here.
05 * @authornull Jam Jenkins
06 */
07 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 HelloGame extendsextends means to customize or extend the functionality of a class GameLoop
08 {open braces start code blocks and must be matched with a close brace
09 privateprivate is used to restrict access to the current class only Sprite hello;
10
11 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
12 {open braces start code blocks and must be matched with a close brace
13 hello=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor StringSprite("Hello World");
14 hello.setLocation(0.5, 0.5);
15 canvas.addSprite(hello);
16 }close braces end code blocks and must match an earlier open brace
17 }close braces end code blocks and must match an earlier open brace
|
Download/View Jam/HelloGame.java