Ejemplo n.º 1
0
  /** Initialize game. */
  public void init() {
    //		// Create characters
    //		Human h1 = new Human("Human 1", HP_HUMANS);
    //		Human h2 = new Human("Human 2", HP_HUMANS);
    //		Vampire v1 = new Vampire("Vampire 1", HP_VAMPIRES);
    //		Vampire v2 = new Vampire("Vampire 2", HP_VAMPIRES);
    //		Zombie z1 = new Zombie("Zombie 1", HP_ZOMBIES);
    //		MadZombie mz1 = new MadZombie("MadZombie 1", HP_ZOMBIES);
    // Add characters to the list
    characterList = new ArrayList<Character>();
    //		characterList.add(h1);
    //		characterList.add(h2);
    //		characterList.add(v1);
    //		characterList.add(v2);
    //		characterList.add(z1);
    //		characterList.add(mz1);
    /*humans = new ArrayList<Human>();
    zombies = new ArrayList<Zombie>();
    vampires = new ArrayList<Vampire>();
    madZombies = new ArrayList<MadZombie>();*/
    //	    humans.add(h1);
    //	    humans.add(h2);
    //	    vampires.add(v1);
    //	    vampires.add(v2);
    //	    zombies.add(z1);
    //	    madZombies.add(mz1);

    shotguns = new ArrayList<ShotGun>();
    nitrogens = new ArrayList<LiquidNitrogen>();
    stakes = new ArrayList<WoodenStake>();

    field = new Field(DEFAULT_DEPTH, DEFAULT_WIDTH);

    // Create a view of the state of each location in the field.
    view = new SimulatorView(DEFAULT_DEPTH, DEFAULT_WIDTH);
    view.setColor(Human.class, Color.orange);
    view.setColor(Zombie.class, Color.green);
    view.setColor(Vampire.class, Color.black);
    view.setColor(MadZombie.class, Color.red);
    view.setColor(BaseObject.class, Color.cyan);

    // Setup a valid starting point.
    reset();
  }