examples/levelSelect/Level1

From FANG

Jump to: navigation, search

01 package examples.levelSelect;
02 
03 import fang.*;
04 
05 /**
06  * Level 1
07  @author Alex Park
08  @author modified by Jam when the
09  * FANG Engine was updated
10  */
11 public class Level1 extends Game
12 {
13    /**Message to send to level*/
14    private String message;
15    /**
16     * Constructs a level with the string
17     * in the parameter.
18     @param string The message
19     */
20    public Level1(String string)
21    {
22       message = string;
23    }
24    /**
25     @see fang.GameLevel#startLevel()
26     */
27    public void setup()
28    {
29       StringSprite sprite=new StringSprite(message);
30       sprite.setWidth(0.85);
31       sprite.setLocation(0.50.5);
32       addSprite(sprite);
33    }
34 
35    /**
36     @see fang.GameLevel#advanceFrame(double)
37     */
38    public void advance(double timePassed)
39    {
40       if(getClick2D()!=null)
41       {
42          addGame(new LevelSelect());
43          finishGame();
44       }
45    }
46 }


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