Example usage for com.badlogic.gdx.physics.box2d World getBodyCount

List of usage examples for com.badlogic.gdx.physics.box2d World getBodyCount

Introduction

In this page you can find the example usage for com.badlogic.gdx.physics.box2d World getBodyCount.

Prototype

public int getBodyCount() 

Source Link

Document

Get the number of bodies.

Usage

From source file:se.danielj.geometridestroyer.IngameStage.java

License:GNU General Public License

public IngameStage(final Core core, World world, GeometriDestroyer geometriDestroyer) {
    this.world = world;
    this.geometriDestroyer = geometriDestroyer;

    setViewport(Constants.STAGE_WIDTH, Constants.STAGE_HEIGHT, false);

    LabelStyle style = new LabelStyle();
    style.font = FontManager.getNormalFont();
    style.fontColor = new Color(0, 0, 0, 1);
    objectCounter = new Label("Total Number Of Objects: " + (world.getBodyCount() - 1)
            + "\nObject left To Destroy: " + geometriDestroyer.boxesLeft, style);
    objectCounter.setPosition(20, Constants.STAGE_HEIGHT - 120);
    addActor(objectCounter);//  ww  w .  java 2s .  com

    gameOverMenu = new GameOverMenu(core);
    gameOverMenu.setVisible(false);
    addActor(gameOverMenu);

    victoryMenu = new VictoryMenu(core);
    victoryMenu.setVisible(false);
    addActor(victoryMenu);

    pauseMenu = new PauseMenu(core);
    pauseMenu.setVisible(false);
    addActor(pauseMenu);
}