Package models.terrains

Source Code of models.terrains.ElementTD

/*
  Copyright (C) 2010 Aurelien Da Campo, Lazhar Farjallah,
  Pierre-Dominique Putallaz

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package models.terrains;
import java.awt.Color;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.io.File;
import models.jeu.Jeu;
import models.jeu.ModeDeJeu;
import models.joueurs.EmplacementJoueur;
import models.joueurs.Equipe;

/**
* Classe de gestion du fameux terrain Element TD repris de chez Blizzard.
*
* Cette classe herite de la classe Terrain de base.
*
* @author Pierre-Dominique Putallaz
* @author Aurelien Da Campo
* @author Lazhar Farjallah
* @version 1.0 | 13 decembre 2009
* @since jdk1.6.0_16
* @see Terrain
*/
public class ElementTD extends Terrain
{
    private static final long serialVersionUID = 1L;
    public final static Image IMAGE_DE_FOND;
    public final static Image IMAGE_MENU;
    public final static File  FICHIER_MUSIQUE_DE_FOND;
    public final static String NOM = "ElementTD";

    static
    {
        FICHIER_MUSIQUE_DE_FOND = new File("snd/ambient/Filippo Vicarelli - The War Begins.mp3");
       
        IMAGE_MENU    = Toolkit.getDefaultToolkit().getImage(
                                          "img/cartes/menu_principal/elementTD.png");
      IMAGE_DE_FOND = Toolkit.getDefaultToolkit().getImage(
                                                       "img/cartes/elementTD.png");
    }
 
    /**
     * Constructeur d'un terrain ElementTD selon la celebre map de Blizzard.
     */
    public ElementTD (Jeu jeu)
    {
        superjeu,
                480// largeur
                500// hauteur
                100// nbPiecesOrInitiales
                20,   // nbViesInitiales
                0,    // positionMaillageX
                -40,    // positionMaillageY
                480// largeurMaillage
                540// hauteurMaillage
                ModeDeJeu.MODE_SOLO, // mode de jeu
                new Color(197,148,90), // couleur de fond
                new Color(91,123,43)// couleur des murs
                IMAGE_DE_FOND, // imageDeFond
                NOM  // nom
          );
       
        opaciteMurs = 0.f;
       
        // Création des équipes
        Equipe e = new Equipe(1,"Equipe par defaut",Color.BLACK);
        e.ajouterZoneDepartCreatures(new Rectangle(110, -40, 80, 20));
        e.setZoneArriveeCreatures(new Rectangle(250, 0, 40, 40));
        e.ajouterEmplacementJoueur(new EmplacementJoueur(1,new Rectangle(0,0,480,500)));
        equipes.add(e);
       
       
        fichierMusiqueDAmbiance = FICHIER_MUSIQUE_DE_FOND;
       
        /*
         * Définition des murs du labyrinthe.
         */
        ajouterMur(new Rectangle(0, -40, 100, 60));
        ajouterMur(new Rectangle(0, 20, 20, 480));
        ajouterMur(new Rectangle(20, 480, 440, 20));
        ajouterMur(new Rectangle(460, 20, 20, 480));
        ajouterMur(new Rectangle(320, -40, 160, 60));
        ajouterMur(new Rectangle(200, -40, 20, 140));
        ajouterMur(new Rectangle(120, 100, 240, 20));
        ajouterMur(new Rectangle(120, 120, 20, 20));
        ajouterMur(new Rectangle(340, 120, 20, 260));
        ajouterMur(new Rectangle(120, 360, 220, 20));
        ajouterMur(new Rectangle(20, 240, 220, 20));
        ajouterMur(new Rectangle(220, 220, 20, 20));
    }
}
TOP

Related Classes of models.terrains.ElementTD

TOP
Copyright © 2018 www.massapi.com. 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.