Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Vector2f


  {
    this.life -= entity.damage;
    if (life < 0){
      this.unSpawn();
      hit = new BulletHit(IEntity.BULLET_HIT_YELLOW);
      hit.spawn(this.position,new Vector2f(0,0),Prototyp.fx);
      return true;
    }
    return false;
     
  }
View Full Code Here


    rightKey = right;
    fire1Key = fire1;
    fire2Key = fire2;
   
   
    concentrateAnimation.spawn(new Vector2f(0,0),new Vector2f(0,0),Prototyp.fx);
    accelerateEntrity.spawn(new Vector2f(0,0),new Vector2f(0,0),Prototyp.fx);
    this.type = PLAYER_SHIP;
    init();
    //setRatio(0.17f);
    setRatio(0.25f);
    //this.setOrb(new LightningOrb(this));
View Full Code Here

    if (this.orb != null && this.orb.type == orb.type)
      return;
    if (this.orb != null )
      this.orb.unSpawn();
    this.orb = orb;
    this.orb.spawn(new Vector2f(-430,0),new Vector2f(0,0),Prototyp.bullets);
  }
View Full Code Here

  public void addBooster(Layer layer)
  {
    if (booster1 == null)
    {
      booster1 = new BitUpgrade(this);
      booster1.spawn(new Vector2f(5,20),new Vector2f(500,0),layer);
      return;
    }
    if (booster2 == null)
    {
      booster2 = new BitUpgrade(this);
      booster2.spawn(new Vector2f(5,-20),new Vector2f(500,0),layer);
      return;
    }
  }
View Full Code Here

  public static Vector2f makeNormalForPoints(Vector2f p1, Vector2f p2)
  {
    float diffY = p2.y - p1.y;
    float diffX = p2.x - p1.x;
   
    return new Vector2f(-diffY/diffX,1);
  }
View Full Code Here

    this.position.x = orb.position.x;
    this.position.y = orb.position.y;
    this.rotation = orb.rotation;
    this.damage = 1000;
   
    Vector2f p1 ;
    Vector2f p2 ;
    int i,k;
   
   
    for(i=0, k=1; i<(int)p.length-1; i++, k++)
    {
      p1=p[i];
      p2=p[k];
      meltingPoints.add(0,p1);
      Vector2f norm = GLUTILS.makeNormalForPoints(p1,p2);
      if (Logger.isLogActivate) Logger.log("norm"+norm);
     
     
      int ran = (int) (Prototyp.random.nextInt() % modulo + minimalArcHeight);
     
     
      Vector2f mid= bWay ? 
        new Vector2f(p1.x + ((p2.x-p1.x)*0.5f) + norm.x *  ran,
               p1.y + ((p2.y-p1.y)*0.5f) + norm.y *  ran)
        :
        new Vector2f(p1.x  + ((p2.x - p1.x )*0.5f) - norm.x * ran,
               p1.y  + ((p2.y - p1.y )*0.5f) - norm.y * ran
            );
     
      if (bWay)
      {
View Full Code Here

  private static Vector2f calculatePointOnCurve(Vector2f[] c, float distance)
  {
    float a = 1;
    float b = 0;
    float step = distance;
    Vector2f p = new Vector2f();
    a-=step;
    b=1-a;
    p.x = c[0].x*a*a + c[2].x*2*a*b + c[1].x*b*b;
    p.y = c[0].y*a*a + c[2].y*2*a*b + c[1].y*b*b;
    return p;
View Full Code Here

      GL11.glRotatef(rotation,0f,0f,1f);
     
           GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
           //GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

      Vector2f p,p2,p3,n,n2;
     
     
      GL11.glColor4f(r,g,b,a);
     
      GL11.glBegin(GL11.GL_QUADS);
View Full Code Here

    EventManager.instance().addListener(Keyboard.KEY_SPACE,space);   
   
    int pointY = ORIGIN_Y;
    int pointX = ORIGIN_X;
   
    Vector2f immobile = new Vector2f(0,0);
   
   
   
    PlayerShip lightning = new PlayerShip();
    LightningOrb lorb = new LightningOrb(lightning);
   
    PlayerShip rapid = new PlayerShip();
    RapidFireOrb rforb = new RapidFireOrb(rapid);
   
    PlayerShip magnetic = new PlayerShip();
    MagneticOrb morb = new MagneticOrb(magnetic);
   
    PlayerShip crystal = new PlayerShip();
    CrystalOrb corb = new CrystalOrb(crystal);
   
    PlayerShip booster = new PlayerShip();
   
    BonusLightningOrb lBonus = new BonusLightningOrb();
        BonusRapidShootOrb rBonus = new BonusRapidShootOrb();
        BonusMagneticOrb mBonus = new BonusMagneticOrb();
        BonusCrystalOrb cBonus = new BonusCrystalOrb();
        BonusBooster bBonus = new BonusBooster();
       
        Text commandLabel = new Text("One more thing...");
        Text lightningLabel = new Text("Lightning Orb :");
        Text rapidLabel =     new Text("RapidFire Orb :");
        Text magneticLabel =  new Text("Magnetic  Orb :");
        Text crystalLabel =   new Text("Crystal   Orb :");
        Text boosterLabel =   new Text("Booster   Orb :");
       
       
    commandLabel.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
    pointX = ORIGIN_X - interspaceX*2;
        pointY = ORIGIN_Y;
       
        pointY-=interspaceY;
        lightningLabel.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        rapidLabel.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        magneticLabel.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        crystalLabel.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        boosterLabel.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
    pointX = ORIGIN_X + 50 ;
        pointY = ORIGIN_Y;
   
        pointY-=interspaceY;
        lBonus.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        rBonus.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        mBonus.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        cBonus.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointY-=interspaceY;
        bBonus.spawn(new Vector2f(pointX,pointY), immobile, layer);
       
        pointX = ORIGIN_X + interspaceX+ 50;
        pointY = ORIGIN_Y;
       
        pointY-=interspaceY;
        lightning.spawn(new Vector2f(pointX,pointY), immobile, nullLayer);
        lorb     .spawn(new Vector2f(pointX-400,pointY), immobile, layer);
       
        pointY-=interspaceY;
        rapid    .spawn(new Vector2f(pointX,pointY), immobile, nullLayer);
        rforb    .spawn(new Vector2f(pointX-400,pointY), immobile, layer);
       
        pointY-=interspaceY;
        magnetic .spawn(new Vector2f(pointX,pointY), immobile, nullLayer);
        morb     .spawn(new Vector2f(pointX-400,pointY), immobile, layer);
       
        pointY-=interspaceY;
        crystal  .spawn(new Vector2f(pointX,pointY), immobile, nullLayer);
        corb     .spawn(new Vector2f(pointX-400,pointY), immobile, layer);
   
        pointY-=interspaceY;
        booster  .spawn(new Vector2f(pointX+60,pointY), immobile, nullLayer);
        booster.addBooster(layer);
    booster.addBooster(layer);

   
   
View Full Code Here

  }
 
  public void fire()
  {
    // Fire a bullet to player's ship
    Vector2f directionToplayer = new Vector2f(Prototyp.player1.position.x-this.position.x,Prototyp.player1.position.y-this.position.y);
    directionToplayer.normalise();
    directionToplayer.x *= 50;
    directionToplayer.y *= 50;
   
    EnemyBullet b = new EnemyBullet();
   
View Full Code Here

TOP

Related Classes of org.lwjgl.util.vector.Vector2f

Copyright © 2018 www.massapicom. 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.