Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Line


    float spread = GameplayState.player.gun.opt_spreading-GameplayState.player.gun.opt_spreading_add;
    float rand = new Random().nextFloat()*6-3; //[-3..3]
    vector_mouse.setTheta(vector_mouse.getTheta()+rand/5*spread); //rand/spread_max*(spread-spread_add)
    n_x = vector_mouse.x;
    n_y = vector_mouse.y;
    bullet = new Line(this.x, this.y, curr_x, curr_y);
    while(true) //set 2nd gradient line
    {
      curr_x += n_x; curr_y += n_y;
      if (GameplayState.player.gun.opt_distance_is_power)
        power_add += 0.1f+Elements.extractLevel(ITEM.P_GUN_DISTANCE_IS_POWER)*0.035f;
      drawLine();
      if (checkCollision() == 0)
      {
        float length = bullet.length();
        if (length > 220)
        {
          length = 220;
          original_line_render = true;
        }
        else
          original_line_render = false;
        fire_x = this.x;
        fire_y = this.y;
        while(new Line(x, y, fire_x, fire_y).length() <= length)
        {
          fire_x += n_x;
          fire_y += n_y;
        }
        break;
View Full Code Here


      float recoil = GameplayState.player.gun.opt_recoil;
      vector_mouse.setTheta(vector_mouse.getTheta()+new Random().nextFloat()*5-recoil/2);
      n_x = vector_mouse.x;
      n_y = vector_mouse.y;
      g = Game.app.getGraphics();
      bullet = new Line(this.x+GameplayState.player.gun.gun_x, this.y+GameplayState.player.gun.gun_y, this.x, this.y);
      while(true)
      {
        curr_x += n_x; curr_y += n_y;
        drawLine();
        if (checkCollision())
View Full Code Here

      float rand = new Random().nextFloat()*22-11; //[-11..11]
      vector_mouse.setTheta(vector_mouse.getTheta()+rand/7*(recoil+2f));
      n_x = vector_mouse.x;
      n_y = vector_mouse.y;
      g = Game.app.getGraphics();
      bullet = new Line(this.x, this.y, curr_x[i], curr_y[i]);
      while(true)
      {
        curr_x[i] += n_x; curr_y[i] += n_y;
        drawLine(i);
        if (checkCollision() || bullet.length() > length)
View Full Code Here

      }
      direction = !direction;
      n_x = vector_end.x;
      n_y = vector_end.y;
      g = Game.app.getGraphics();
      bullet = new Line(curr_x[0], curr_y[0], curr_x[0], curr_y[0]);
      int generated_length = new Random().nextInt(45)+size-(size_penalty_annigilator?0:25);
      if (size_penalty_annigilator)
        size_penalty_annigilator = false;
      curr_x[i+1] = curr_x[i]; //lightning special code
      curr_y[i+1] = curr_y[i];
View Full Code Here

   
    float[] in = new float[] {x1,y1,x2,y2};
    float[] out = new float[4];
   
    transform.transform(in,0,out,0,2);
    Line line = new Line(out[0],out[1],out[2],out[3]);
   
    NonGeometricData data = Util.getNonGeometricData(element);
    data.addAttribute("x1",""+x1);
    data.addAttribute("x2",""+x2);
    data.addAttribute("y1",""+y1);
View Full Code Here

    sx = x;
    sy = y + height / 2;

    if (faceRight) {
      sight = new Line(sx, sy, sx + 32 * SIGHT_SIZE, sy);
    } else {
      sight = new Line(sx, sy, sx - 32 * SIGHT_SIZE, sy);
    }

    fireSnd = ResourceManager.getSound("fireArrow");
  }
View Full Code Here

    end = new Vector2f(centerTwoX, centerTwoY);
    float heading = calculateAngle(start.x, start.y, end.x, end.y);
    Transform t = Transform.createRotateTransform(heading, centerOneX,
        centerOneY);
    shape = shape.transform(t);
    line = new Line(centerOneX, centerOneY, centerTwoX, centerTwoY);
  }
View Full Code Here

   
    float[] in = new float[] {x1,y1,x2,y2};
    float[] out = new float[4];
   
    transform.transform(in,0,out,0,2);
    Line line = new Line(out[0],out[1],out[2],out[3]);
   
    NonGeometricData data = Util.getNonGeometricData(element);
    data.addAttribute("x1",""+x1);
    data.addAttribute("x2",""+x2);
    data.addAttribute("y1",""+y1);
View Full Code Here

    trans.transform(e, 0, e, 0, 1);
   
    start = new Vector2f(s[0],s[1]);
    end = new Vector2f(e[0],e[1]);
   
    line = new Line(start, end);
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.geom.Line

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.