examples/levelSelect/Level1

From FANG

Jump to: navigation, search

01 package examples.levelSelect;
02 
03 import fang2.attributes.*;
04 import fang2.core.*;
05 import fang2.sprites.*;
06 import fang2.transformers.*;
07 
08 /**
09  Level 1
10  @author Alex Park
11  @author modified by Jam when the
12  * FANG Engine was updated
13  */
14 public class Level1 extends Game
15 {
16   /**Message to send to level*/
17   private String message;
18   /**
19    * Constructs a level with the string
20    * in the parameter.
21    @param string The message
22    */
23   public Level1(String string)
24   {
25     message = string;
26   }
27 
28   /**
29    * makes and adds the sprite
30    */
31   public void setup()
32   {
33     StringSprite sprite=new StringSprite(message);
34     sprite.setWidth(0.85);
35     sprite.setLocation(0.50.5);
36     addSprite(sprite);
37   }
38 
39   /**
40    * adds the next game when clicked
41    */
42   public void advance()
43   {
44     if(getClick2D()!=null)
45     {
46       addGame(new LevelSelect());
47       finishGame();
48     }
49   }
50 }
51 
52 //Uploaded on Sat Sep 19 13:57:59 EDT 2009


Download/View examples/levelSelect/Level1.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

Games
Games