Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Circle


  public static void drawCircle(Graphics g, double centreX, double centreY, double radius) {
    g.drawOval((float) (centreX - radius), (float) (centreY - radius), (float) radius * 2, (float) radius * 2, 100);
  }

  public static Circle getCircle(double centreX, double centreY, double radius) {
    Circle c = new Circle((float) centreX, (float) centreY, (float) radius);
    return c;
  }
View Full Code Here


  public void render(GameContainer gc, final Graphics g) throws SlickException {
    this.renderCurrentRoboter(g);
  }

  public boolean intersectWithPoint(Point2d point) {
    Circle c = SlickRenderUtils.getCircle(roboter.getX(), roboter.getY(), 20);
    return c.contains((float) point.getX(), (float) point.getY());
  }
View Full Code Here

    g.drawString("Max I [" + lightBulb.getMaxIntensity() + "]", lightBulb.getX() - 50, lightBulb.getY() + 10);

  }

  public boolean intersectWithPoint(Point2d point) {
    Circle c = SlickRenderUtils.getCircle(lightBulb.getX(), lightBulb.getY(), 20);
    return c.contains((float) point.getX(), (float) point.getY());
  }
View Full Code Here

 
  private List<Projectile>   bullet_array = new ArrayList<Projectile>();
 
  public Gun()
  {
    exception_circle = new Circle(GameplayState.player.getX()-17, GameplayState.player.getY()-13, 28);
    exception_circle_f = new Circle(GameplayState.player.getX()-10, GameplayState.player.getY()-13, 28);
    gun = Util.loadImage("player/gun.png");
    gun_f = gun.getFlippedCopy(true, false);
    gun.setCenterOfRotation(2, 2); //do not move gun to gun and gun_f to gun_f
    gun_f.setCenterOfRotation(24, 2);
    /*strange bug:
View Full Code Here

      if (mob_state != MS.DEAD && mob_state != MS.NULL)
      {
        Rectangle mob_hitbox = list.get(i).hitbox; 
        for (float j = 0; j < radius; j += 3)
        {
          if (mob_hitbox.intersects(new Circle(x, y, j)) && mobNotDamaged(list.get(i), dmg_list))
          {
            float knockback = power; //calculate knockback
            knockback += (pc?2+pc_lvl:0);
            knockback += (th?4+th_lvl*0.8f:0);
            knockback += km_lvl*0.8f;
 
View Full Code Here

            poly.addPoint((x * 32) + 32, y * 32);
            poly.addPoint(x * 32, (y * 32) + 32);
            original.add(poly);
            break;
          case 3:
            Circle ellipse = new Circle((x*32)+16,(y*32)+32,16,16);
            original.add(ellipse);
            break;
          case 4:
            Polygon p = new Polygon();
            p.addPoint((x * 32) + 32, (y * 32));
 
View Full Code Here

        shapes.add(rect);
        roundRect = new RoundedRectangle(150, 10, 60, 80, 20);
        shapes.add(roundRect);
        ellipse = new Ellipse(350, 40, 50, 30);
        shapes.add(ellipse);
        circle = new Circle(470, 60, 50);
        shapes.add(circle);
        polygon = new Polygon(new float[]{550, 10, 600, 40, 620, 100, 570, 130});
        shapes.add(polygon);
       
        keys = new boolean[256];
View Full Code Here

    return this.center.y - this.radius;
  }

  @Override
  public Shape toSlickShape() {
    return new Circle(this.center.x, this.center.y, this.radius);
  }
View Full Code Here

    this.e = zombie;
  }

  public void init() {
    Log.debug("i'm alert");
    radarCircle = new Circle(e.x + e.width / 2, e.y + e.height / 2, radar);

  }
View Full Code Here

    radarCircle = new Circle(e.x + e.width / 2, e.y + e.height / 2, radar);

  }

  public void update(GameContainer container, int delta) {
    radarCircle = new Circle(e.x + e.width / 2, e.y + e.height / 2, radar);
    timer += delta;
    if (timer >= 1000) {
      timer = 0;
      List<Entity> onSight = e.intersect(radarCircle);
      if (onSight != null && !onSight.isEmpty()) {
View Full Code Here

TOP

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

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.