From ggc
Cat Dream
- This is an interactive art "game", based on a what a cat might dream about.
Images
- All Images used were created with the Gimp
|
01 packagepackage is used to name the directory or folder a class is in William_Anderson;
02 importimport means to make the classes and/or packages available in this program wiki.Wiki;
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 importimport means to make the classes and/or packages available in this program Beta.OutlineTracker;
07 /**
08 * There is no spoon.
09 * @authornull Wanderso
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 Art extendsextends means to customize or extend the functionality of a class GameLoop
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 intint is the type for whole numbers and it is short for integer clickCount;
14 privateprivate is used to restrict access to the current class only Sprite background;
15 privateprivate is used to restrict access to the current class only Sprite cathop;
16 privateprivate is used to restrict access to the current class only OutlineTracker tracker;
17 privateprivate is used to restrict access to the current class only Sprite fish;
18 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value startGame()
19 {open braces start code blocks and must be matched with a close brace
20 makeSprites();
21 addSprites();
22 clickCount=this assignment operator makes the left side equal to the right side0;
23 setHelpText("Clicking causes stuff to appear");
24 }close braces end code blocks and must match an earlier open brace
25 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value makeSprites()
26 {open braces start code blocks and must be matched with a close brace
27 background=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("Willbg2.jpg"));
28 background.setScale(1.4);
29 background.setLocation(0.5, 0.5);
30 cathop=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite (Wiki.getMedia("Cathop.gif"));
31 cathop.setScale(1);
32 cathop.setLocation(.4,.5);
33 fish=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("Willfish.gif"));
34 fish.setScale(0.3);
35 fish.setLocation(0.5, 0.5);
36 //fish.setBlurLength(5);
37 Sprite outline=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("Willpath.gif"));
38 outline.setScale(3);
39 outline.setLocation(0.5, 0.5);
40 canvas.addSprite(outline);
41 tracker=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor OutlineTracker(outline, -0.5);
42 tracker.setLooping(truetrue is the boolean value that is the opposite of false);
43 fish.setTracker(tracker);
44 fish.setLocation(tracker.getCurrentPoint());
45 }close braces end code blocks and must match an earlier open brace
46 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value addSprites()
47 {open braces start code blocks and must be matched with a close brace
48 canvas.addSprite(background);
49 canvas.addSprite(cathop);
50 canvas.addSprite(fish);
51 }close braces end code blocks and must match an earlier open brace
52 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value doStage1Interaction()
53 {open braces start code blocks and must be matched with a close brace
54 ImageSprite Swirl=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("Willspin4.gif"));
55 Point2D.Double location=this assignment operator makes the left side equal to the right sidegetPlayer().getMouse().getClickLocation();
56 Swirl.setLocation(location);
57 Swirl.setScale(0.4);
58 canvas.addSprite(Swirl);
59 clickCount=this assignment operator makes the left side equal to the right side1;
60 }close braces end code blocks and must match an earlier open brace
61 privateprivate is used to restrict access to the current class only voidvoid means the method does not return a value doStage2Interaction()
62 {open braces start code blocks and must be matched with a close brace
63 ImageSprite Swirl2=this assignment operator makes the left side equal to the right sidenewnew is used to create objects by calling the constructor ImageSprite(Wiki.getMedia("Willfish.gif"));
64 Point2D.Double location=this assignment operator makes the left side equal to the right sidegetPlayer().getMouse().getClickLocation();
65 Swirl2.setLocation(location);
66 Swirl2.setScale(0.8);
67 canvas.addSprite(Swirl2);
68 clickCount=this assignment operator makes the left side equal to the right side0;
69 }close braces end code blocks and must match an earlier open brace
70 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)
71 {open braces start code blocks and must be matched with a close brace
72 ifif executes the next statement only if the condition in parenthesis evaluates to true(getPlayer().getMouse().getClickLocation()!=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)
73 {open braces start code blocks and must be matched with a close brace
74 ifif executes the next statement only if the condition in parenthesis evaluates to true(clickCount==this is the comparison operator which evaluates to true if both sides are the same0)
75 {open braces start code blocks and must be matched with a close brace
76 doStage1Interaction();
77 }close braces end code blocks and must match an earlier open brace
78 elseelse is what happens when the if condition is false ifif executes the next statement only if the condition in parenthesis evaluates to true(clickCount==this is the comparison operator which evaluates to true if both sides are the same1)
79 {open braces start code blocks and must be matched with a close brace
80 doStage2Interaction();
81 }close braces end code blocks and must match an earlier open brace
82 }close braces end code blocks and must match an earlier open brace
83 }close braces end code blocks and must match an earlier open brace
84 }close braces end code blocks and must match an earlier open brace
|
Compiler Errors:
----------
1. ERROR in William_Anderson/Art.java (at line 27)
background=new ImageSprite(Wiki.getMedia("Willbg2.jpg"));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The constructor ImageSprite(URL) is undefined
----------
2. ERROR in William_Anderson/Art.java (at line 30)
cathop=new ImageSprite (Wiki.getMedia("Cathop.gif"));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The constructor ImageSprite(URL) is undefined
----------
6 problems (6 errors)
Download/View William_Anderson/Art.java