PollingGuessingGame

From ggc

Jump to: navigation, search

01 /**
02  * All about my application here.
03  @author Jam Jenkins  
04  */
05 public class PollingGuessingGame
06 {
07   private Guess guess;
08   private ConsoleEngine engine;
09 
10   public void startGame()
11   {
12     guess=new Guess();
13     engine=new ConsoleEngine();
14   }
15 
16   public void advanceFrame(double timepassed)
17   {
18     if(guess.gameIsOver()==false)
19     {
20       engine.giveOutput(guess.getHint());
21       String input=engine.getInput();
22       int num=Integer.parseInt(input);
23       guess.setGuess(num);
24     }
25   }
26 
27   public static void main(String[] args)
28   {
29     PollingGuessingGame game=new PollingGuessingGame();
30     game.startGame();
31     while(true)
32       game.advanceFrame(1.0/25.0);
33   }
34 }


Download/View PollingGuessingGame.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