|
001 packagepackage is used to name the directory or folder a class is in Brandon;
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 fang.*;
005 importimport means to make the classes and/or packages available in this program java.awt.*;
006 importimport means to make the classes and/or packages available in this program java.awt.geom.*;
007
008 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 Solitaire extendsextends means to customize or extend the functionality of a class GameLoop
009 {open braces start code blocks and must be matched with a close brace
010 privateprivate is used to restrict access to the current class only OvalSprite[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays circles =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor OvalSprite[brackets are typically used to declare, initialize and index (indicate which element of) arrays9]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays9]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
011 privateprivate is used to restrict access to the current class only RectangleSprite[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays squares =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite[brackets are typically used to declare, initialize and index (indicate which element of) arrays9]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays9]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
012 SolitaireLogic logic =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor SolitaireLogic();
013 privateprivate is used to restrict access to the current class only booleanboolean is a type that is either true or false[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays]brackets are typically used to declare, initialize and index (indicate which element of) arrays choice =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor booleanboolean is a type that is either true or false[brackets are typically used to declare, initialize and index (indicate which element of) arrays9]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays9]brackets are typically used to declare, initialize and index (indicate which element of) arrays;
014 privateprivate is used to restrict access to the current class only booleanboolean is a type that is either true or false first =this assignment operator makes the left side equal to the right side truetrue is the boolean value that is the opposite of false;
015
016 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
017 {open braces start code blocks and must be matched with a close brace
018
019 setHelpText("Eliminate circles by 'hopping' over them <br><br> Try to remove all but one circle <br><br> R to Restart");
020 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 side 0; i < 9; i++this is the increment operator, which increases the variable by 1)
021 {open braces start code blocks and must be matched with a close brace
022 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 u =this assignment operator makes the left side equal to the right side 0; u < 9; u++this is the increment operator, which increases the variable by 1)
023 {open braces start code blocks and must be matched with a close brace
024 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor RectangleSprite(1, 1);
025 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setScale(0.1);
026 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.WHITE);
027 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setLocation((0.11 * (u +adds two numbers together or concatenates Strings together 1)) - 0.051, (0.11 * (i +adds two numbers together or concatenates Strings together 1)) - 0.051);
028
029 circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side newnew is used to create objects by calling the constructor OvalSprite(1, 1);
030 circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setScale(0.09);
031 circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.BLUE);
032 circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setVisible(truetrue is the boolean value that is the opposite of false);
033 circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setLocation((0.11 * (u +adds two numbers together or concatenates Strings together 1)) - 0.051, (0.11 * (i +adds two numbers together or concatenates Strings together 1)) - 0.051);
034
035 canvas.addSprite(squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays, circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays);
036
037 choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side falsefalse is a value for the boolean type and means not true;
038 }close braces end code blocks and must match an earlier open brace
039 }close braces end code blocks and must match an earlier open brace
040
041 squares[brackets are typically used to declare, initialize and index (indicate which element of) arrays4]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays4]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.RED);
042 circles[brackets are typically used to declare, initialize and index (indicate which element of) arrays4]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays4]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setVisible(falsefalse is a value for the boolean type and means not true);
043 logic.restart();
044 }close braces end code blocks and must match an earlier open brace
045
046 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)
047 {open braces start code blocks and must be matched with a close brace
048 Point2D.Double click =this assignment operator makes the left side equal to the right side getPlayer().getMouse().getClickLocation();
049
050 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 side 0; i < 9; i++this is the increment operator, which increases the variable by 1)
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 u =this assignment operator makes the left side equal to the right side 0; u < 9; u++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 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 different nullnull 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 &&) circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.intersects(click))
055 {open braces start code blocks and must be matched with a close brace
056 ifif executes the next statement only if the condition in parenthesis evaluates to true(first)
057 {open braces start code blocks and must be matched with a close brace
058 ifif executes the next statement only if the condition in parenthesis evaluates to true(logic.check(i, u))
059 {open braces start code blocks and must be matched with a close brace
060 choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side truetrue is the boolean value that is the opposite of false;
061 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.GRAY);
062 first =this assignment operator makes the left side equal to the right side falsefalse is a value for the boolean type and means not true;
063 }close braces end code blocks and must match an earlier open brace
064 }close braces end code blocks and must match an earlier open brace
065 elseelse is what happens when the if condition is false
066 {open braces start code blocks and must be matched with a close brace
067 ifif executes the next statement only if the condition in parenthesis evaluates to true(!this is the not operator, which changes true to false and false to truelogic.check(i, u))
068 {open braces start code blocks and must be matched with a close brace
069 ifif executes the next statement only if the condition in parenthesis evaluates to true((i - 2) >=this evaluates to true if the left side is not less than the right side 0 &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 &&) choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi - 2]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays ==this is the comparison operator which evaluates to true if both sides are the same truetrue is the boolean value that is the opposite of false)
070 {open braces start code blocks and must be matched with a close brace
071 logic.trigger(i, u);
072 logic.trigger(i - 1, u);
073 trig(i - 2, u);
074 }close braces end code blocks and must match an earlier open brace
075 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true((i +adds two numbers together or concatenates Strings together 2) <=this evaluates to true if the left side is not more than the right side 8 &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 &&) choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi +adds two numbers together or concatenates Strings together 2]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays ==this is the comparison operator which evaluates to true if both sides are the same truetrue is the boolean value that is the opposite of false)
076 {open braces start code blocks and must be matched with a close brace
077 logic.trigger(i, u);
078 logic.trigger(i +adds two numbers together or concatenates Strings together 1, u);
079 trig(i +adds two numbers together or concatenates Strings together 2, u);
080 }close braces end code blocks and must match an earlier open brace
081 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true((u - 2) >=this evaluates to true if the left side is not less than the right side 0 &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 &&) choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu - 2]brackets are typically used to declare, initialize and index (indicate which element of) arrays ==this is the comparison operator which evaluates to true if both sides are the same truetrue is the boolean value that is the opposite of false)
082 {open braces start code blocks and must be matched with a close brace
083 logic.trigger(i, u);
084 logic.trigger(i, u - 1);
085 trig(i, u - 2);
086 }close braces end code blocks and must match an earlier open brace
087 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true((u +adds two numbers together or concatenates Strings together 2) <=this evaluates to true if the left side is not more than the right side 8 &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 &&) choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu +adds two numbers together or concatenates Strings together 2]brackets are typically used to declare, initialize and index (indicate which element of) arrays ==this is the comparison operator which evaluates to true if both sides are the same truetrue is the boolean value that is the opposite of false)
088 {open braces start code blocks and must be matched with a close brace
089 logic.trigger(i, u);
090 logic.trigger(i, u +adds two numbers together or concatenates Strings together 1);
091 trig(i, u +adds two numbers together or concatenates Strings together 2);
092 }close braces end code blocks and must match an earlier open brace
093 elseelse is what happens when the if condition is false
094 {open braces start code blocks and must be matched with a close brace
095 choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side falsefalse is a value for the boolean type and means not true;
096 clear();
097 first =this assignment operator makes the left side equal to the right side truetrue is the boolean value that is the opposite of false;
098 }close braces end code blocks and must match an earlier open brace
099 }close braces end code blocks and must match an earlier open brace
100 elseelse is what happens when the if condition is false
101 {open braces start code blocks and must be matched with a close brace
102 choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side falsefalse is a value for the boolean type and means not true;
103 clear();
104 first =this assignment operator makes the left side equal to the right side truetrue is the boolean value that is the opposite of false;
105 }close braces end code blocks and must match an earlier open brace
106
107 }close braces end code blocks and must match an earlier open brace
108 }close braces end code blocks and must match an earlier open brace
109
110 circles[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setVisible(logic.check(i, u));
111 }close braces end code blocks and must match an earlier open brace
112 }close braces end code blocks and must match an earlier open brace
113
114 ifif executes the next statement only if the condition in parenthesis evaluates to true(getPlayer().getKeyboard().getLastKey() ==this is the comparison operator which evaluates to true if both sides are the same 'r')
115 logic.restart();
116 }close braces end code blocks and must match an earlier open brace
117
118 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value trig(intint is the type for whole numbers and it is short for integer a, intint is the type for whole numbers and it is short for integer b)
119 {open braces start code blocks and must be matched with a close brace
120 logic.trigger(a, b);
121 first =this assignment operator makes the left side equal to the right side truetrue is the boolean value that is the opposite of false;
122 choice[brackets are typically used to declare, initialize and index (indicate which element of) arraysa]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysb]brackets are typically used to declare, initialize and index (indicate which element of) arrays =this assignment operator makes the left side equal to the right side falsefalse is a value for the boolean type and means not true;
123 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysa]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysb]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.WHITE);
124 }close braces end code blocks and must match an earlier open brace
125
126 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value clear()
127 {open braces start code blocks and must be matched with a close brace
128 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 side 0; i < 9; i++this is the increment operator, which increases the variable by 1)
129 {open braces start code blocks and must be matched with a close brace
130 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 u =this assignment operator makes the left side equal to the right side 0; u < 9; u++this is the increment operator, which increases the variable by 1)
131 squares[brackets are typically used to declare, initialize and index (indicate which element of) arraysi]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arraysu]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.WHITE);
132 }close braces end code blocks and must match an earlier open brace
133
134 squares[brackets are typically used to declare, initialize and index (indicate which element of) arrays4]brackets are typically used to declare, initialize and index (indicate which element of) arrays[brackets are typically used to declare, initialize and index (indicate which element of) arrays4]brackets are typically used to declare, initialize and index (indicate which element of) arrays.setColor(Color.RED);
135 }close braces end code blocks and must match an earlier open brace
136 }close braces end code blocks and must match an earlier open brace
|