examples/splash/GameOverSplash

From FANG

Jump to: navigation, search

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


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