Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Vector2f


  @Override
  public int getQuad(float x, float y, float z, float width, float height) {
   
    int mesh = beginMesh();
   
    int v1 = addVertexToMesh(new Vector3f(x, y, z), new Vector2f(0.0f, 0.0f));
    int v2 = addVertexToMesh(new Vector3f(x + width, y, z), new Vector2f(1.0f, 0.0f));
    int v3 = addVertexToMesh(new Vector3f(x + width, y + height, z), new Vector2f(1.0f, 1.0f));
    int v4 = addVertexToMesh(new Vector3f(x, y + height, z), new Vector2f(0.0f, 1.0f));
   
    addTriangleToMesh(v1, v2, v3);
    addTriangleToMesh(v1, v3, v4);
   
    finishMesh();
View Full Code Here


   
    public Controller(AbstractEntity e, float x, float y){
  this.entity = e;
  this.x = x;
  this.y = y;
        this.accelerate = new Vector2f(0,0);
  this.hitbox = new Rectangle((int)this.x,(int)this.y,(int)this.entity.getElement().getSpriteSizeX(),(int)this.entity.getElement().getSpriteSizeY());
  if(CONF.debugLevel >= 3)
      System.out.println("[DEBUG] X = "+(int)this.x+" ; Y = "+(int)this.y+" ; SX = "+(int)this.entity.getElement().getSpriteSizeX()+" ; SY = "+(int)this.entity.getElement().getSpriteSizeY()+" ; ");
    }
View Full Code Here

  public Intro(Prototyp prototyp)
  {
    this.prototyp = prototyp;
   
    Planet planet= new Planet(IEntity.PLANET);
      planet.spawn(new Vector2f(320,0),new Vector2f(7f*-1,0),Prototyp.background);
   
    layer = new Layer();
   
    Text title = new Text (" . Prototyp .");
    Text commandLabel = new Text("- Commands -");
    Text commandLabel0 = new Text("P            : Pause.");
    Text commandLabel1 = new Text("F1           : Start homing missile.");
    Text commandLabel2 = new Text("F2           : Start enemy waves.");
    Text commandLabel3 = new Text("X            : Detach/Move Orb.");
    Text commandLabel4 = new Text("Arrow key    : Move.");
    Text commandLabel5 = new Text("Space        : Fire ( maintain to charge).");
    Text commandLabel6 = new Text("Press SPACE to Start !!");
    Vector2f immobile = new Vector2f(0,0);
   
    int pointY = 240;
    int pointX = -270;
    int interspace = 20;
   
    title.spawn(new Vector2f(pointX+160,pointY -=interspace*4), immobile, layer);
    commandLabel.spawn(new Vector2f(pointX+200,pointY -=interspace*4), immobile, layer);
    commandLabel0.spawn(new Vector2f(pointX,pointY -=interspace*2), immobile, layer);
    commandLabel1.spawn(new Vector2f(pointX,pointY -=interspace), immobile, layer);
    commandLabel2.spawn(new Vector2f(pointX,pointY -=interspace), immobile, layer);
    commandLabel3.spawn(new Vector2f(pointX,pointY -=interspace), immobile, layer);
    commandLabel4.spawn(new Vector2f(pointX,pointY -=interspace), immobile, layer);
    commandLabel5.spawn(new Vector2f(pointX,pointY -=interspace), immobile, layer);
    commandLabel6.spawn(new Vector2f(pointX+150,pointY -=interspace*3), immobile, layer);

   
    KeyListener space = new KeyListener()
    {
        public void onKeyUp()
View Full Code Here

      if (bulletTimeCounter > FIRE_RATE_LIMIT)
      {
        bulletsToFire--;
        bulletTimeCounter = 0 ;
        bu = new RapidFireBullet(this.rotation);
        bu.spawn(this.position,new Vector2f((float)(Math.cos(rotationRadians))*BULLETS_SPEED,(float)(Math.sin(rotationRadians))*BULLETS_SPEED),Prototyp.bullets);
      }
      if (bulletsToFire < 0 )
      {
        distanceFromShipRequested = DEFAULT_DISTANCE_FROM_SHIP;
      }
View Full Code Here

  private static float MIN_BEAM_HEIGHT = 50;
 
  public void fireBeam()
  {
    Vector2f[] p = new Vector2f[5];
    p[0] = new Vector2f(0,0);
    p[1] = new Vector2f(130,0);
    p[2] = new Vector2f(350,0);
    p[3] = new Vector2f(850,0);
    p[4] = new Vector2f(1950,0);
   
   
    OrbBeam ob = new OrbBeam(this,p,2f,true,0.3f,0.8f,1,0.85f,20,MIN_BEAM_HEIGHT);
    ob.spawn(this.position,new Vector2f(-75.3f,0),Prototyp.fx);
   
    Vector2f[] p2 = new Vector2f[5];
    p2[0] = new Vector2f(0,0);
    p2[1] = new Vector2f(130,0);
    p2[2] = new Vector2f(370,0);
    p2[3] = new Vector2f(870,0);
    p2[4] = new Vector2f(1970,0);
   
    OrbBeam ob2 = new OrbBeam(this,p,3f,false,0.3f,0.8f,1f,0.85f,20,MIN_BEAM_HEIGHT);
    ob2.spawn(this.position,new Vector2f(-75.3f,0),Prototyp.fx);
   
    Vector2f[] p3 = new Vector2f[4];
    p3[0] = new Vector2f(0,0);
    p3[1] = new Vector2f(200,0);
    p3[2] = new Vector2f(840,0);
    p3[3] = new Vector2f(940,0);
   
    OrbBeam ob3 = new OrbBeam(this,p3,3f,Prototyp.random.nextInt(2) == 0 ? false : true,1f,1f,1f,0.85f,15,MIN_BEAM_HEIGHT-10);
    ob3.spawn(this.position,new Vector2f(-75.3f,0),Prototyp.fx);
   
    Vector2f[] p4 = new Vector2f[4];
    p4[0] = new Vector2f(0,0);
    p4[1] = new Vector2f(200,0);
    p4[2] = new Vector2f(440,0);
    p4[3] = new Vector2f(940,0);
   
    OrbBeam ob4 = new OrbBeam(this,p3,55f,Prototyp.random.nextInt(2) == 0 ? false : true,1f,1f,1f,0.3f,15,MIN_BEAM_HEIGHT-40);
    ob4.spawn(this.position,new Vector2f(-75.3f,0),Prototyp.fx);
   
    /*
    Vector2f[] p5 = new Vector2f[4];
    p5[0] = new Vector2f(0,0);
    p5[1] = new Vector2f(200,0);
    p5[2] = new Vector2f(440,0);
    p5[3] = new Vector2f(940,0);
   
    OrbBeam ob5 = new OrbBeam(this,p3,25f,Prototyp.random.nextInt(2) == 0 ? false : true,1f,1f,1f,0.4f,0,MIN_BEAM_HEIGHT-40);
    ob5.spawn(this.position,new Vector2f(-75.3f,0),Prototyp.fx);
    */
   
   
    Vector2f[] p6 = new Vector2f[4];
    p6[0] = new Vector2f(0,0);
    p6[1] = new Vector2f(200,0);
    p6[2] = new Vector2f(440,0);
    p6[3] = new Vector2f(940,0);
   
    OrbBeam ob6 = new OrbBeam(this,p3,20f,Prototyp.random.nextInt(2) == 0 ? false : true,1f,1f,1f,0.8f,0,MIN_BEAM_HEIGHT-40);
    ob6.spawn(this.position,new Vector2f(-75.3f,0),Prototyp.fx);
   
   
    min_y = Math.min(ob.getMinNormalWidth(),ob2.getMinNormalWidth());
      max_y = Math.max(ob.getMaxNormalWidth(),ob2.getMaxNormalWidth());
   
View Full Code Here

      addBasicEntities();
     
      player1.addEventListeners();
     
      Bonus b = BonusFactory.createBonus(IEntity.BONUS_LIGHTNING_ORB);
      b.spawn(new Vector2f(player1.position.x+100,player1.position.y), DEFAULT_SCROLLING_SPEED, bonus);
     
     
      addControlKeys();
     
     
View Full Code Here



   private void addBasicEntities() {
     player1 = new PlayerShip(); // Calling default constructor, if you want to chanage them: PlayerShip(Use Keyboard.KEY_UP,Keyboard.KEY_DOWN,Keyboard.KEY_LEFT,Keyboard.KEY_RIGHT,Keyboard.KEY_SPACE,Keyboard.KEY_X)
          player1.spawn(new Vector2f(-150,-100),new Vector2f(0,0),bullets);
          player1.addBooster();
         
          textFPS = new Text("");
          textFPS.spawn(new Vector2f(SCREEN_WIDTH/2-100,SCREEN_HEIGHT/2-20),new Vector2f(0,0),text);
 
          textHisCore = new Text("HISCORE:");
          textHisCore.spawn(new Vector2f(-SCREEN_WIDTH/2+20,SCREEN_HEIGHT/2 - 20),new Vector2f(0,0),text);
         
          entitiesCount = new TextEntityCounter();
          entitiesCount.spawn(new Vector2f(-SCREEN_WIDTH/2+20,-SCREEN_HEIGHT/2 + 20),new Vector2f(0,0),text);
   
  }
View Full Code Here

            }
            else
            {
                pause = new Text("GAME PAUSED");
              //pause.setRatio(1.5f);
              pause.spawn(new Vector2f(-50,0),new Vector2f(0,0),frontground);
              timer.pause();
            }
        };
       };
       EventManager.instance().addListener(Keyboard.KEY_P, pauseKeyEvent);
View Full Code Here

    float speedAngleInRadians = 0;
    float targetAngleInRadians = 0;
    float angleDifferenceInRadians = 0;
    float angleToAdd = 0;
   
    Vector2f targetCooRelativeToThis = new Vector2f();
   
    if (target.life <= 0)
      acquiereNewTarget(target.getLayer());
    if (target == null)
      return;
View Full Code Here

  public void fire(float chargePercentage)
  {
    if (Prototyp.enemies.entities.size() != 0)
       {
         HomingMissile m = new HomingMissile(Prototyp.enemies,(float)Math.PI / 1000);
         m.spawn(position,new Vector2f(400,0),Prototyp.bullets);
       }
   
  }
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.