private void drawLevelScore(GameController gamecontroller, int score) { drawTextBox(levelFinishedBounds.height * 3.5f); genericTextBoxMap .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_LEVEL)) .draw( batch, Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_LEVEL) + gamecontroller.getTextBoxLevel(), border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - levelFinishedBounds.width / 2, (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT)) * ppuy); genericTextBoxMap .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_TIME)) .draw( batch, Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_TIME) + gamecontroller.getTimeNeeded(), border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - levelFinishedBounds.width / 2, (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT + Helper.BREAK_SIZE)) * ppuy - levelFinishedBounds.height); genericTextBoxMap .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_BONUS)) .draw( batch, Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_BONUS) + score, border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - levelFinishedBounds.width / 2, (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT + Helper.BREAK_SIZE)) * ppuy - levelFinishedBounds.height * 2); genericTextBoxMap .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_TAP)) .draw( batch, Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_TAP), border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - tapBounds.width / 2, (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT + Helper.BREAK_SIZE)) * ppuy - levelFinishedBounds.height * 3); }
public void draw( final Ship ship, final StarManager starManager, final EnemyManager enemyManager, final PowerUpManager powerupManager, final ShotManager shotManager, final GamePhase phase, final GameController controller) { if (phase == GamePhase.GAMING) { shotManager.drawShape(shapeRenderer, ppux, ppuy, border); powerupManager.drawShape(shapeRenderer, ppux, ppuy, border); shapeRenderer.begin(ShapeType.FilledRectangle); enemyManager.drawHealthBar(shapeRenderer, ppux, ppuy, border); shapeRenderer.end(); } shapeRenderer.setColor(Color.WHITE); starManager.drawShape(shapeRenderer, ppux, ppuy, border); ship.drawShape(shapeRenderer, ppux, ppuy, border); batch.begin(); ship.drawSprite(batch, ppux, ppuy, border); switch (phase) { case LEVEL_LOAD: // just waiting for refresh case GAMING: shotManager.drawSprite(batch, ppux, ppuy, border); powerupManager.drawSprite(batch, ppux, ppuy, border); enemyManager.drawSprite(batch, ppux, ppuy, border); break; case PAUSE: drawPauseTextBox(); break; case LEVEL_SCORE: // TODO make counter and stuff and at the end change phase // score = GameScreen.updatePhase(GamePhase.LEVEL_WAIT); case LEVEL_WAIT: drawLevelScore(controller, controller.getTimeBonus()); break; case DEAD: // TODO death animation drawGameOver(); break; case FINISHED: drawGameFinished(); break; case GAMESTART: break; default: break; } batch.end(); }
public void drawMisc(Ship ship, GameController controller) { batch.begin(); batch.draw( Textures.BOMB_TEXTURE, border + (Sizes.DEFAULT_WORLD_WIDTH - Sizes.SHOT_BOMB_WIDTH - Sizes.MISC_BOMB_INFO_OFFSET) * ppux, 0.1f * ppuy, ppux * Sizes.SHOT_BOMB_WIDTH, ppuy * Sizes.SHOT_BOMB_HEIGHT); miscTextFont.draw( batch, "x" + String.valueOf(ship.getBombs()), border + (Sizes.DEFAULT_WORLD_WIDTH - Sizes.MISC_BOMB_INFO_OFFSET) * ppux, Sizes.FONT_SIZE_MISC * ppuy); miscTextFont.draw( batch, "Level: " + controller.getLevel(), border + 1 * ppux, (Sizes.DEFAULT_WORLD_HEIGHT - Sizes.MISC_POINT_INFO_OFFSET) * ppuy); miscTextFont.draw( batch, "Points: " + controller.points, border + (Sizes.DEFAULT_WORLD_WIDTH / 2) * ppux, (Sizes.DEFAULT_WORLD_HEIGHT - Sizes.MISC_POINT_INFO_OFFSET) * ppuy); batch.end(); shapeRenderer.begin(ShapeType.Line); shapeRenderer.setColor(Color.WHITE); shapeRenderer.line(border, 0, border, Sizes.DEFAULT_WORLD_HEIGHT * ppuy); shapeRenderer.line( border + Sizes.DEFAULT_WORLD_WIDTH * ppux, 0, border + Sizes.DEFAULT_WORLD_WIDTH * ppux, Sizes.DEFAULT_WORLD_HEIGHT * ppuy); shapeRenderer.end(); }