Example/Deal1

From ggc

Jump to: navigation, search

01 package Example;
02 
03 import wiki.Wiki;
04 import fang.*;
05 import java.awt.*;
06 import java.awt.geom.*;
07 
08 /**
09  * All about my game here.
10  @author Jam Jenkins
11  */
12 public class Deal1 extends GameLoop
13 {
14   private Sprite  box1;
15   
16   public void startGame()
17   {
18     makeSprites();
19     addSprites();
20   }
21   
22   private void makeSprites()
23   {
24     box1=new RectangleSprite(11);
25     box1.setScale(0.25);
26     box1.setLocation(0.50.5);
27   }
28   
29   private void addSprites()
30   {
31     canvas.addSprite(box1);
32   }
33   
34   public void advanceFrame(double timePassed)
35   {
36     Point2D.Double click=getPlayer().getMouse().getClickLocation();
37     //did they click at all
38     if(click!=null)
39     {
40       if(box1.intersects(click))
41       {
42         canvas.removeSprite(box1);
43       }
44     }
45   }
46 }


Download/View Example/Deal1.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter