Package org.newdawn.fizzy

Examples of org.newdawn.fizzy.Circle


  protected void placeCrosshairs(){
    Body currentBeaverBody = currentPlayer.getCurrentBeaver().getBody();
    world.remove(crosshair);
    float x = (float) (currentBeaverBody.getX() + 100*Math.sin(Math.toRadians(crosshairAngle)));
    float y = (float) (currentBeaverBody.getY() + 100*Math.cos(Math.toRadians(crosshairAngle)));
    crosshair = new StaticBody(new Circle(10),x,y);
    world.add(crosshair);
    crosshair.setActive(false);
  }
View Full Code Here


    terrainyImage = terrainy.getImage();
    createTerrainBody2(-terrainyImage.getWidth()/2, -terrainyImage.getHeight()/2);
   
    for (int i = 0; i < Constants.BEAVERS_PER_TEAM; i++) {
      int[] coord = randomFreeCoordinate(20);
      if (coord[0] < 0) p1.getTeam()[i].setBody(new DynamicBody(new Circle(10.0f), -100*i, 1300));
      else p1.getTeam()[i].setBody(new DynamicBody(new Circle(10.0f), (coord[0]-terrainyImage.getWidth()/2), (coord[1]-terrainyImage.getHeight()/2)));
      p1.getTeam()[i].getBody().setDensity(1);
      p1.getTeam()[i].getBody().setFriction(1000);
      p1.getTeam()[i].getBody().setRestitution(0f);
      p1.getTeam()[i].getBody().setAngularDamping(1f);
      p1.getTeam()[i].getBody().setFixedRotation(true);
      world.add(p1.getTeam()[i].getBody());
    }
   
    for (int i = 0; i < Constants.BEAVERS_PER_TEAM; i++) {
      int[] coord = randomFreeCoordinate(20);
      if (coord[0] < 0) p2.getTeam()[i].setBody(new DynamicBody(new Circle(10.0f), -100*i, 1300));
      else p2.getTeam()[i].setBody(new DynamicBody(new Circle(10.0f), (coord[0]-terrainyImage.getWidth()/2), (coord[1]-terrainyImage.getHeight()/2)));
      p2.getTeam()[i].getBody().setDensity(1);
      p2.getTeam()[i].getBody().setFriction(1000);
      p2.getTeam()[i].getBody().setRestitution(0f);
      p2.getTeam()[i].getBody().setAngularDamping(1f);
      p2.getTeam()[i].getBody().setFixedRotation(true);
View Full Code Here

            powerSeqEngaged = true;
          }
          else {
            powerSeqEngaged = false;
            currentBeaverBody.setActive(false);
            bullet = new DynamicBody(new Circle(5),currentBeaverBody.getX(),currentBeaverBody.getY());
            bullet.setBullet(true);
            bullet.setRestitution(0);
            float x = (float) (Math.sin(Math.toRadians(crosshairAngle)));
            float y = (float) (Math.cos(Math.toRadians(crosshairAngle)));
            float xForce = (power/50)*(x)*10000000f;
 
View Full Code Here

    private int value;
    public DynamicBody body;
    public boolean remove = false;
    protected Item() {
      int[] coord = randomFreeCoordinate(20);
      if (coord[0] < 0) this.body = new DynamicBody(new Circle(10.0f), -100, 1300);
      else this.body = new DynamicBody(new Circle(10.0f), (coord[0]-terrainyImage.getWidth()/2), (coord[1]-terrainyImage.getHeight()/2));
      this.value = 1;
      this.remove = false;
    }
View Full Code Here

    terrainyImage = terrainy.getImage();
    createTerrainBody2(-terrainyImage.getWidth()/2, -terrainyImage.getHeight()/2);
 
    for (int i = 0; i < Constants.BEAVERS_PER_TEAM; i++) {
      int[] coord = randomFreeCoordinate(20);
      p1.getTeam()[i].setBody(new DynamicBody(new Circle(10.0f), -100*i, 1300));
      p1.getTeam()[i].getBody().setDensity(1);
      p1.getTeam()[i].getBody().setFriction(1000);
      p1.getTeam()[i].getBody().setRestitution(0f);
      p1.getTeam()[i].getBody().setAngularDamping(1f);
      p1.getTeam()[i].getBody().setFixedRotation(true);
      world.add(p1.getTeam()[i].getBody());
    }
   
    for (int i = 0; i < Constants.BEAVERS_PER_TEAM; i++) {
      int[] coord = randomFreeCoordinate(20);
      p2.getTeam()[i].setBody(new DynamicBody(new Circle(10.0f), -100*i, 1300));
      p2.getTeam()[i].getBody().setDensity(1);
      p2.getTeam()[i].getBody().setFriction(1000);
      p2.getTeam()[i].getBody().setRestitution(0f);
      p2.getTeam()[i].getBody().setAngularDamping(1f);
      p2.getTeam()[i].getBody().setFixedRotation(true);
View Full Code Here

              powerSeqEngaged = true;
            }
            else {
              powerSeqEngaged = false;
              currentBeaverBody.setActive(false);
              bullet = new DynamicBody(new Circle(5),currentBeaverBody.getX(),currentBeaverBody.getY());
              bullet.setBullet(true);
              bullet.setRestitution(0);
              float x = (float) (Math.sin(Math.toRadians(crosshairAngle)));
              float y = (float) (Math.cos(Math.toRadians(crosshairAngle)));
              float xForce = (power/50)*(x)*10000000f;
 
View Full Code Here

          powerSeqEngaged = true;
        }
        else {
          powerSeqEngaged = false;
          currentBeaverBody.setActive(false);
          bullet = new DynamicBody(new Circle(5),currentBeaverBody.getX(),currentBeaverBody.getY());
          bullet.setBullet(true);
          bullet.setRestitution(0);
          float x = (float) (Math.sin(Math.toRadians(crosshairAngle)));
          float y = (float) (Math.cos(Math.toRadians(crosshairAngle)));
          float xForce = (power/50)*(x)*10000000f;
 
View Full Code Here

TOP

Related Classes of org.newdawn.fizzy.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.