Atacante.java :  » UnTagged » chowtower » com » chow » android » game » chowtower » atacantes » Android Open Source

Android Open Source » UnTagged » chowtower 
chowtower » com » chow » android » game » chowtower » atacantes » Atacante.java
package com.chow.android.game.chowtower.atacantes;

import android.graphics.Region;

import com.chow.android.game.chowtower.movimiento.Trayectoria;

public abstract class Atacante {
  public static int LADO_IZQ = 1;
  public static int LADO_DCHA = -1;
  
  public static String STATE_RUN = "RUN";
  public static String STATE_DEAD = "DEAD";
  public static String STATE_ATACK = "ATACK";
  
  protected int mAniIndex = 0;
  protected float posX = (float) 0.0; //Posicin del atacante en el eje de las X
  protected float posY = (float) 0.0; //posicin del atacante en el eje de las Y
  protected float ancho = (float) 0.0; //ancho de la imagen del atacante
  protected float alto = (float) 0.0; //alto de la imagen del atacante
  protected int vida = 100; //Puntos de vitalidad del atacante
  protected int velocidad = 4; //Pxel x segundo
  protected int poderAt = 1; //Poder de ataque del atacante
  protected int nivel = 1; //Nivel de dificultad del atacante
  protected int puntos = 1; //Puntuacin que dar la unidad al morir
  protected int rangoAt = 1; //distancia mnima a la que puede atacar al objetivo
    protected int posAtaq = LADO_IZQ; //distancia mnima a la que puede atacar al objetivo
    protected boolean estaMuerto = false; //Est vivo o muerto
    protected String estado = STATE_RUN; //Est vivo o muerto
    
    protected Region regionAtacante;  // Region que ocupa el atacante
    
  
    protected float m = 0;
    protected float b = 0;
    
  public Atacante ()
    {
      
    }
  
    public Atacante (float pX, float pY, float w, float h, int vida, int vel, int poderAt, int nvl, int pts, int rAt)
    {
      this.posX = pX;
      this.posY = pY;
      this.ancho = w;
      this.alto = h;
      this.vida = vida;
      this.velocidad = vel;
      this.poderAt = poderAt;
      this.nivel = nvl;
      this.puntos = pts;
      this.rangoAt = rAt;
      
      
      if (pX > 100)
      {
        this.posAtaq = LADO_DCHA;
      }
      
    }
    

    public abstract void setSigPos();
  
    
    public int getmAniIndex() {
    return mAniIndex;
  }

  public void setmAniIndex(int mAniIndex) {
    this.mAniIndex = mAniIndex;
  }

  public float getPosX() {
    return posX;
  }

  public void setPosX(float posX) {
    this.posX = posX;
  }

  public float getPosY() {
    return posY;
  }

  public void setPosY(float posY) {
    this.posY = posY;
  }

  public float getAncho() {
    return ancho;
  }

  public void setAncho(float ancho) {
    this.ancho = ancho;
  }

  public float getAlto() {
    return alto;
  }

  public void setAlto(float alto) {
    this.alto = alto;
  }

  public int getVida() {
    return vida;
  }

  public void setVida(int vida) {
    this.vida = vida;
  }

  public int getVelocidad() {
    return velocidad;
  }

  public void setVelocidad(int velocidad) {
    this.velocidad = velocidad;
  }

  public int getPoderAt() {
    return poderAt;
  }

  public void setPoderAt(int poderAt) {
    this.poderAt = poderAt;
  }

  public int getNivel() {
    return nivel;
  }

  public void setNivel(int nivel) {
    this.nivel = nivel;
  }

  public int getPuntos() {
    return puntos;
  }

  public void setPuntos(int puntos) {
    this.puntos = puntos;
  }

  public int getRangoAt() {
    return rangoAt;
  }

  public void setRangoAt(int rangoAt) {
    this.rangoAt = rangoAt;
  }

  public boolean isEstaMuerto() {
    return estaMuerto;
  }

  public void setEstaMuerto(boolean estaMuerto) {
    this.estaMuerto = estaMuerto;
  }
  
    public int getPosAtaq() {
    return posAtaq;
  }

  public void setPosAtaq(int posAtaq) {
    this.posAtaq = posAtaq;
  }

  public String getEstado() {
    return estado;
  }

  public void setEstado(String estado) {
    this.estado = estado;
  }

  public Region getRegionAtacante() {
    regionAtacante = new Region((int)this.posX,(int)this.posY,(int)(this.posX+ancho),(int)(this.posY+alto));
    return regionAtacante;
  }

  public void setRegionAtacante(Region regionAtacante) {
    this.regionAtacante = regionAtacante;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.