blooming8

COD Zombie - Main

Jul 29th, 2014
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. package codzombie;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         int punti = 5000;
  11.  
  12.         Giocatore Nikolai = new Giocatore(punti);
  13.         Giocatore Takeo, Dempsey, Richtofen = new Giocatore(punti);
  14.  
  15.         try {
  16.             System.out.println("Fare un giro di cassa? [y/n]"); // Giro?
  17.             if (in.nextLine().charAt(0) == 'y') { // Risposta affermativa
  18.                 while (Nikolai.ControllaPunti(punti)) { // Se ci sono 950 punti o di più
  19.                     Nikolai.GiroDiCassa(punti); // Nikolai fa un giro di cassa
  20.                     Nikolai.Commento(); // Nikolai commenta l'arma uscita
  21.                     Nikolai.GetInfo(); // Resoconto dei punti rimasti
  22.                     // Chiede all'utente se vuole fare un altro giro
  23.                     System.out.println("\nUn altro giro di cassa?");
  24.                     if (in.nextLine().charAt(0) == 'n') {
  25.                         break;
  26.                     }
  27.                 }
  28.                 System.out.println("\nNon hai abbastanza punti.");
  29.             }
  30.         } catch (Exception error) {
  31.             System.out.println("ERRORE");
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment