|
001 packagepackage is used to name the directory or folder a class is in jam;
002
003 importimport means to make the classes and/or packages available in this program wiki.Wiki;
004 importimport means to make the classes and/or packages available in this program java.util.*;
005 importimport means to make the classes and/or packages available in this program fang.*;
006 importimport means to make the classes and/or packages available in this program java.awt.*;
007 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
008
009 /**
010 * All about my game here.
011 * @authorthis is the Javadoc tag for documenting who created the source code Jam Jenkins
012 */
013 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 DotsDisappear extendsextends means to customize or extend the functionality of a class GameLoop
014 {open braces start code blocks and must be matched with a close brace
015 privateprivate is used to restrict access to the current class only ArrayList<Sprite> oval;
016
017 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
018 {open braces start code blocks and must be matched with a close brace
019 oval=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ArrayList<Sprite>();
020 //oval=new OvalSprite(1, 1);
021 //oval.setScale(0.75);
022 //oval.setLocation(0.5, 0.5);
023 //canvas.addSprite(oval);
024 makePlus();
025 }close braces end code blocks and must match an earlier open brace
026
027 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value advanceFrame(doubledouble is the type for numbers that can contain decimal fractions timePassed)
028 {open braces start code blocks and must be matched with a close brace
029 Point2D.Double click=this assignment operator makes the left side equal to the right sidegetPlayer().getMouse().getClickLocation();
030 forfor is a looping structure for repeatedly executing a block of code(Sprite one: oval)
031 {open braces start code blocks and must be matched with a close brace
032 ifif executes the next statement only if the condition in parenthesis evaluates to true(click!=this is the not equals operator which evaluates to true if both sides are differentnullnull is the value used to refer to a non-existant object &this performs a bit-wise and (not the same as boolean and which is &&)&this performs a bit-wise and (not the same as boolean and which is &&) one.intersects(click))
033 canvas.removeSprite(one);
034 }close braces end code blocks and must match an earlier open brace
035 }close braces end code blocks and must match an earlier open brace
036
037 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makePlus()
038 {open braces start code blocks and must be matched with a close brace
039 makeDotsAcross(0.1, 50);
040 makeDotsAcross(0.3, 50);
041 makeDotsAcross(0.5, 50);
042 makeDotsAcross(0.7, 50);
043 makeDotsAcross(0.9, 50);
044 //makeDotsAcross0();
045 //makeDotsAcross1();
046 //makeDotsAcross2();
047 //makeDotsDown();
048 }close braces end code blocks and must match an earlier open brace
049
050 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeDotsAcross(doubledouble is the type for numbers that can contain decimal fractions y, intint is the type for whole numbers and it is short for integer numDots)
051 {open braces start code blocks and must be matched with a close brace
052 forfor is a looping structure for repeatedly executing a block of code(intint is the type for whole numbers and it is short for integer i=this assignment operator makes the left side equal to the right side0; i<numDots; i++this is the increment operator, which increases the variable by 1)
053 {open braces start code blocks and must be matched with a close brace
054 doubledouble is the type for numbers that can contain decimal fractions x=this assignment operator makes the left side equal to the right side(i+adds two numbers together or concatenates Strings together0.5)/numDots;
055 OvalSprite dot=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
056 dot.setScale((1.0/numDots)/2);
057 dot.setLocation(x, y);
058 canvas.addSprite(dot);
059 oval.add(dot);
060 }close braces end code blocks and must match an earlier open brace
061 }close braces end code blocks and must match an earlier open brace
062
063 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeDotsAcross0()
064 {open braces start code blocks and must be matched with a close brace
065 intint is the type for whole numbers and it is short for integer numDots=this assignment operator makes the left side equal to the right side5;
066 forfor is a looping structure for repeatedly executing a block of code(intint is the type for whole numbers and it is short for integer i=this assignment operator makes the left side equal to the right side0; i<numDots; i++this is the increment operator, which increases the variable by 1)
067 {open braces start code blocks and must be matched with a close brace
068 doubledouble is the type for numbers that can contain decimal fractions x=this assignment operator makes the left side equal to the right side(i+adds two numbers together or concatenates Strings together0.5)/numDots;
069 doubledouble is the type for numbers that can contain decimal fractions y=this assignment operator makes the left side equal to the right side0.4;
070 OvalSprite dot=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
071 dot.setScale((1.0/numDots)/2);
072 dot.setLocation(x, y);
073 canvas.addSprite(dot);
074 }close braces end code blocks and must match an earlier open brace
075 }close braces end code blocks and must match an earlier open brace
076 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeDotsAcross1()
077 {open braces start code blocks and must be matched with a close brace
078 intint is the type for whole numbers and it is short for integer numDots=this assignment operator makes the left side equal to the right side5;
079 forfor is a looping structure for repeatedly executing a block of code(intint is the type for whole numbers and it is short for integer i=this assignment operator makes the left side equal to the right side0; i<numDots; i++this is the increment operator, which increases the variable by 1)
080 {open braces start code blocks and must be matched with a close brace
081 doubledouble is the type for numbers that can contain decimal fractions x=this assignment operator makes the left side equal to the right side(i+adds two numbers together or concatenates Strings together0.5)/numDots;
082 doubledouble is the type for numbers that can contain decimal fractions y=this assignment operator makes the left side equal to the right side0.5;
083 OvalSprite dot=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
084 dot.setScale((1.0/numDots)/2);
085 dot.setLocation(x, y);
086 canvas.addSprite(dot);
087 }close braces end code blocks and must match an earlier open brace
088 }close braces end code blocks and must match an earlier open brace
089 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeDotsAcross2()
090 {open braces start code blocks and must be matched with a close brace
091 intint is the type for whole numbers and it is short for integer numDots=this assignment operator makes the left side equal to the right side5;
092 forfor is a looping structure for repeatedly executing a block of code(intint is the type for whole numbers and it is short for integer i=this assignment operator makes the left side equal to the right side0; i<numDots; i++this is the increment operator, which increases the variable by 1)
093 {open braces start code blocks and must be matched with a close brace
094 doubledouble is the type for numbers that can contain decimal fractions x=this assignment operator makes the left side equal to the right side(i+adds two numbers together or concatenates Strings together0.5)/numDots;
095 doubledouble is the type for numbers that can contain decimal fractions y=this assignment operator makes the left side equal to the right side0.6;
096 OvalSprite dot=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
097 dot.setScale((1.0/numDots)/2);
098 dot.setLocation(x, y);
099 canvas.addSprite(dot);
100 }close braces end code blocks and must match an earlier open brace
101 }close braces end code blocks and must match an earlier open brace
102
103 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeDotsDown()
104 {open braces start code blocks and must be matched with a close brace
105 intint is the type for whole numbers and it is short for integer numDots=this assignment operator makes the left side equal to the right side5;
106 forfor is a looping structure for repeatedly executing a block of code(intint is the type for whole numbers and it is short for integer i=this assignment operator makes the left side equal to the right side0; i<numDots; i++this is the increment operator, which increases the variable by 1)
107 {open braces start code blocks and must be matched with a close brace
108 doubledouble is the type for numbers that can contain decimal fractions x=this assignment operator makes the left side equal to the right side0.5;
109 doubledouble is the type for numbers that can contain decimal fractions y=this assignment operator makes the left side equal to the right side(i+adds two numbers together or concatenates Strings together0.5)/numDots;
110 OvalSprite dot=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OvalSprite(1, 1);
111 dot.setScale((1.0/numDots)/2);
112 dot.setLocation(x, y);
113 canvas.addSprite(dot);
114 }close braces end code blocks and must match an earlier open brace
115 }close braces end code blocks and must match an earlier open brace
116 }close braces end code blocks and must match an earlier open brace
|