Package crazyOrb.mechanics

Examples of crazyOrb.mechanics.Ball


    canvas.showString("Fortsetzen? P drücken!");
    this.repaint();
  }

  public void repaint() {
    Ball ball = mechanics.getBall();

    lblPoints.setText(ball.getHighscore() + "");
    lblStufe.setText(ball.getLevel() + "");

    int leben = ball.getLifes();
    lblLeben_1.setVisible(true);
    lblLeben_2.setVisible(true);
    lblLeben_3.setVisible(true);

    if (ball.getSpecial() == null) {
      actualSpecial.setText("Kein Special");
    } else {
      actualSpecial.setText(ball.getSpecial().getDescription());
      if (actualSpecial.getText().equals("Shoot Laser") && !laserPickedUp) {
        new SoundThread("DanielNewLaser");
        laserPickedUp = true;
      }
    }
View Full Code Here


        g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        LinkedList<DropableFigure> blocks = mechanics.getBlocks();
        Ball ball = mechanics.getBall();

        double xE = getWidth() / mechanics.getWidth();
        double yE = getHeight() / mechanics.getHeight();

        for (MovableFigure block : blocks) {
            double x = Math.round(block.getxPos() * xE);
            double y = block.getyPos() * yE;
            if (block instanceof Block) {
                g2D.setColor(Color.CYAN);
                g2D.fill(new Rectangle2D.Double(x, y, xE, yE));
            }
            if (block instanceof Special) {
                g2D.setColor(Color.PINK);
                g2D.fill(new RoundRectangle2D.Double(x, y, xE, yE, xE / 10, yE / 2));
            }
        }

        g2D.setColor(color);
        g2D.fill(new Ellipse2D.Double(ball.getxPos() * xE, ball.getyPos() * yE, xE, yE));

        if(laser){
            g2D.setColor(Color.ORANGE);
          g2D.fillRoundRect(
              (int) (ball.getxPos() * xE + xE / 2 - 5 ),
              0,
              10,
              (int) (yE * (mechanics.getHeight() - 1)), 5, 40);
          laser = false;
        }
View Full Code Here

TOP

Related Classes of crazyOrb.mechanics.Ball

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.