examples/splash/GameOverSplash

From FANG

Jump to: navigation, search

01 package examples.splash;
02 //start auto-imports
03 //end auto-imports
04 
05 import fang.*;
06 
07 /**Displays the words Game Over indefinitely.
08  @author Jam Jenkins
09  */
10 public class GameOverSplash extends Game
11 {
12    /**
13     * makes and adds a sprite which says
14     * Game Over
15     */
16    public void setup()
17    {
18       StringSprite sprite=new StringSprite(
19                               "Game Over\n\n"+
20                               "Press any key\n"+
21                               "to start over.");
22       sprite.setWidth(0.85);
23       sprite.setLocation(0.50.5);
24       addSprite(sprite);
25    }
26 
27    /**
28     * waits for the user to click
29     * before advancing to the next level
30     */
31    public void advance()
32    {
33       if(keyPressed())
34       {
35          addGame(new ActualGameLevel("Game Here"));
36          finishGame();
37       }
38    }
39 
40 }


Download/View examples/splash/GameOverSplash.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