@Override public void paint(Graphics g) { if (state == GameState.Running) { // g.drawImage(background, bg1.getBgX(), bg1.getBgY(), this); // g.drawImage(background, bg2.getBgX(), bg2.getBgY(), this); // paintTiles(g); ArrayList projectiles = robot.getProjectiles(); for (int i = 0; i < projectiles.size(); i++) { Projectile p = (Projectile) projectiles.get(i); g.setColor(Color.BLACK); g.fillRect(p.getX(), p.getY(), 35, 2); } for (int i = 0; i < Ballon_Objects.size(); i++) { Ballon bb = Ballon_Objects.get(i); if (bb.isVisible == true) g.drawImage(ballonImage, bb.getCenterX() - 28, bb.getCenterY() - 35, this); else { Ballon_Objects.remove(i); } System.out.println("" + Ballon_Objects.size()); } for (int i = 0; i < Ballon_Bottom_Objects.size(); i++) { BallonBottom bottom = Ballon_Bottom_Objects.get(i); if (bottom.isVisible == true) g.drawImage(ballonBottomImage, bottom.getCenterX() - 10, bottom.getCenterY() + 13, this); else { Ballon_Bottom_Objects.remove(i); } System.out.println("BallonBottom:" + Ballon_Bottom_Objects.size()); } /*g.drawImage(character, robot.getCenterX() - 61, robot.getCenterY() - 63, this); */ g.drawImage(arrowRobot, robot.getCenterX() - 51, robot.getCenterY() - 50, this); g.drawImage(basket, myBasket.getCenterX() - 54, myBasket.getCenterY() - 20, this); /*g.drawImage(hanim.getImage(), hb.getCenterX() - 48, hb.getCenterY() - 48, this); g.drawImage(hanim.getImage(), hb2.getCenterX() - 48, hb2.getCenterY() - 48, this);*/ g.setFont(font); g.setColor(Color.BLACK); g.clearRect(10, 440, 90, 50); g.drawString("Basket : " + Integer.toString(basketScore / 24), 10, 440); g.drawString("Ballons: " + Integer.toString(ballonScore), 10, 470); } else if (state == GameState.Dead) { g.setColor(Color.BLACK); g.fillRect(0, 0, 800, 480); g.setColor(Color.WHITE); g.drawString("Dead", 360, 240); } }