intro/MultiGame

From ggc

Jump to: navigation, search

Compiled in 0.053 seconds.

01 package intro;
02 
03 import fang.*;
04 import java.awt.*;
05 import java.awt.geom.*;
06 
07 /**
08  * All about my game.
09  @author My Name Here
10  */
11 public class MultiGame extends Game
12 {
13    /**an oval*/
14    private Sprite oval;
15 
16    /**sets up the game*/
17    public void setup()
18    {
19       makeSprites();
20       addSprites();
21    }
22 
23    /**makes the sprites*/
24    private void makeSprites()
25    {
26       oval=new StringSprite("Click to start");
27       oval.setSize(0.75);
28       oval.setLocation(0.50.5);
29    }
30 
31    /**adds the sprites to the screen*/
32    private void addSprites()
33    {
34       addSprite(oval);
35    }
36 
37    /**handle input and game events*/
38    public void advance()
39    {
40       if(getClick2D()!=null)
41       {
42          oval.setSize(randomDouble());
43          addGame(new ImageControl());
44          finishGame();
45       }
46    }
47 }


Download/View intro/MultiGame.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