From ggc
Compiled in 0.086 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 MultiLaunch extends Game
12 {
13 /**an oval*/
14 private Sprite one;
15 private Sprite two;
16
17 /**sets up the game*/
18 public void setup()
19 {
20 makeSprites();
21 addSprites();
22 }
23
24 /**makes the sprites*/
25 private void makeSprites()
26 {
27 one=new StringSprite("Doors");
28 one.setSize(0.75);
29 one.setLocation(0.5, 0.25);
30
31 two=new StringSprite("Bricks");
32 two.setSize(0.75);
33 two.setLocation(0.5, 0.75);
34
35 }
36
37 /**adds the sprites to the screen*/
38 private void addSprites()
39 {
40 addSprite(one, two);
41 }
42
43 /**handle input and game events*/
44 public void advance()
45 {
46 if(getClick2D()!=null && one.intersects(getClick2D()))
47 {
48 addGame(new Rohrer.Doors_Assignment_5());
49 finishGame();
50 }
51 if(getClick2D()!=null && two.intersects(getClick2D()))
52 {
53 addGame(new Rohrer.Brick_Breaker_Assignment_7());
54 finishGame();
55 }
56 }
57 }
|
Download/View intro/MultiLaunch.java