Package org.newdawn.fizzy

Examples of org.newdawn.fizzy.StaticBody


  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


    world.addBodyListener(item[0].getBody(), this);
    world.addBodyListener(item[1].getBody(), this);
   
    Body currentBeaverBody = currentPlayer.getCurrentBeaver().getBody();
    crosshairAngle = 45;
    crosshair = new StaticBody(new Rectangle(50f,5f),currentBeaverBody.getX(),currentBeaverBody.getY());
    world.add(crosshair);
    crosshair.setRotation(crosshairAngle);
    crosshairImage = new Image("data/crosshair.png").getScaledCopy(0.5f);
    bulletImage = new Image("data/wood.png").getScaledCopy(0.5f);
    healthImage = new Image("data/health.png").getScaledCopy(0.5f);
View Full Code Here

    compoundTerrain = new CompoundShape();
    for (int i = 0; i < Constants.MAX_WIDTH; i++){
      compoundTerrain.add(terrain[i]);
    }   
   
    terrainBody = new StaticBody(compoundTerrain, x0, y0);
    terrainBody.setFriction(1000);
    terrainBody.setRestitution(0.1f);

    world.add(terrainBody);
    leftmostXFromExplosion = 1000000f;
View Full Code Here

    boundaryShape.add(top);
    boundaryShape.add(left);
    boundaryShape.add(right);
    boundaryShape.add(bottom);

    return new StaticBody(boundaryShape,0,0);
  }
View Full Code Here

    world.addBodyListener(item[0].getBody(), this);
    world.addBodyListener(item[1].getBody(), this);
   
    Body currentBeaverBody = currentPlayer.getCurrentBeaver().getBody();
    crosshairAngle = 45;
    crosshair = new StaticBody(new Rectangle(50f,5f),currentBeaverBody.getX(),currentBeaverBody.getY());
    world.add(crosshair);
    crosshair.setRotation(crosshairAngle);
    crosshairImage = new Image("data/crosshair.png").getScaledCopy(0.5f);
    bulletImage = new Image("data/wood.png").getScaledCopy(0.5f);
    healthImage = new Image("data/health.png").getScaledCopy(0.5f);
View Full Code Here

TOP

Related Classes of org.newdawn.fizzy.StaticBody

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.