Package com.mojang.ld22

Examples of com.mojang.ld22.Game


    xr = 3;
    yr = 2;
  }

  public boolean use(Player player, int attackDir) {
    player.game.setMenu(new CraftingMenu(Crafting.furnaceRecipes, player));
    return true;
  }
View Full Code Here


        menu.tick();
      } else {
        if (player.removed) {
          playerDeadTime++;
          if (playerDeadTime > 60) {
            setMenu(new DeadMenu());
          }
        } else {
          if (pendingLevelChange != 0) {
            setMenu(new LevelTransitionMenu(pendingLevelChange));
            pendingLevelChange = 0;
View Full Code Here

        attack();
      }
    }
    if (input.menu.clicked) {
      if (!use()) {
        game.setMenu(new InventoryMenu(this));
      }
    }
    if (attackTime > 0) attackTime--;

  }
View Full Code Here

          if (playerDeadTime > 60) {
            setMenu(new DeadMenu());
          }
        } else {
          if (pendingLevelChange != 0) {
            setMenu(new LevelTransitionMenu(pendingLevelChange));
            pendingLevelChange = 0;
          }
        }
        if (wonTimer > 0) {
          if (--wonTimer == 0) {
View Full Code Here

    } catch (IOException e) {
      e.printStackTrace();
    }

    resetGame();
    setMenu(new TitleMenu());
  }
View Full Code Here

            pendingLevelChange = 0;
          }
        }
        if (wonTimer > 0) {
          if (--wonTimer == 0) {
            setMenu(new WonMenu());
          }
        }
        level.tick();
        Tile.tickCount++;
      }
View Full Code Here

   }

   // reorder sequence
   // extract method
   public static void play(Random rand) {
      Game aGame = new Game();

      aGame.addPlayer("Chet");
      aGame.addPlayer("Pat");
      aGame.addPlayer("Sue");

      do {

         int diceCast = rand.nextInt(5) + 1;
         aGame.moveCurrentPlayerWith(diceCast);

         boolean correctAnswer = rand.nextInt(9) != 7;
         if (correctAnswer) {
            notAWinner = aGame.currentPlayerGaveCorrectAnswer();
         } else {
            notAWinner = aGame.currentPlayerGaveWrongAnswer();
         }

      } while (notAWinner);
   }
View Full Code Here

   }

   // reorder sequence
   // extract method
   public static void play(Random rand) {
      Game aGame = new Game();

      aGame.add("Chet");
      aGame.add("Pat");
      aGame.add("Sue");

      do {

         aGame.roll(rand.nextInt(5) + 1);

         if (rand.nextInt(9) == 7) {
            notAWinner = aGame.wrongAnswer();
         } else {
            notAWinner = aGame.wasCorrectlyAnswered();
         }

      } while (notAWinner);
   }
View Full Code Here

   }

   // reorder sequence
   // extract method
   public static void play(Random rand) {
      Game aGame = new Game();

      aGame.add("Chet");
      aGame.add("Pat");
      aGame.add("Sue");

      do {

         aGame.roll(rand.nextInt(5) + 1);

         if (rand.nextInt(9) == 7) {
            notAWinner = aGame.wrongAnswer();
         } else {
            notAWinner = aGame.wasCorrectlyAnswered();
         }

      } while (notAWinner);
   }
View Full Code Here

        CurrentPlayer currentPlayer = new CurrentPlayer(players);

        Questions questions = new Questions();

        Game aGame = new Game(currentPlayer, questions);

        boolean notAWinner;
        do {

            aGame.play(rand.nextInt(5) + 1);

            if (rand.nextInt(9) == 7) {
                notAWinner = aGame.wrongAnswer();
            } else {
                notAWinner = aGame.correctAnswer();
            }

        } while (notAWinner);
       
    }
View Full Code Here

TOP

Related Classes of com.mojang.ld22.Game

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.