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

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

import android.graphics.PointF;

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

public class GoompaVolador extends Atacante {

  //private TrayectoriaBezier trayectoria; // Trayectoria a seguir por el atacante
  private TrayectoriaParabolica trayectoria; // Trayectoria a seguir por el atacante
  
  public GoompaVolador() {
    super();
    // TODO Auto-generated constructor stub
  }
  
  public GoompaVolador(float pX, float pY, float w, float h, int vida, int vel,
      int poderAt, int nvl, int pts, int rAt) {
    super(pX, pY, w, h, vida, vel, poderAt, nvl, pts, rAt);
    // TODO Auto-generated constructor stub
      
  }

  @Override
  public void setSigPos() {
    // TODO Auto-generated method stub
    if(trayectoria == null){
      trayectoria = new TrayectoriaParabolica();
      trayectoria.setVelocidad(Trayectoria.VELOCIDAD_LENTA);
      if(this.posAtaq == LADO_IZQ)
      //trayectoria.generarTrayectoriaBezier(new PointF(0,0),new PointF(500,120), new PointF(500,0),new PointF(0,240));
        trayectoria.generarParabolas(new PointF(this.posX,this.posY), new PointF(500,this.posY), 3, Trayectoria.INCLINACION_PRONUNCIADA, Trayectoria.ORIENTACION_CONVEXACONCAVA);
      else{
        trayectoria.generarParabolas(new PointF(0,this.posY), new PointF(this.posX,this.posY), 3, Trayectoria.INCLINACION_PRONUNCIADA, Trayectoria.ORIENTACION_CONVEXACONCAVA);
        trayectoria.empezarDesdePuntoFinal();
      }

      trayectoria.setBidireccional(true);
    }
  
    //this.posX = this.posX + (this.velocidad*this.posAtaq);
    //this.posY = (float) trayectoria.obtenerPuntoY(this.posX);
    
    PointF sigP = trayectoria.obtenerPunto();
    this.posX = sigP.x;
    this.posY = sigP.y;
    
  }
  
  

}
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.