Examples of Ball


Examples of bouncingballs.BouncingBalls.Ball

    // the random seed must be identical for all clients
    randomSeed(1);

    // add a "randomly" placed ball
    balls = new ArrayList<Ball>();
    Ball ball = new Ball(random(client.getMWidth()),
        random(client.getMHeight()));
    balls.add(ball);

  }
View Full Code Here

Examples of bouncingballs.BouncingBalls.Ball

  public void dataEvent(TCPClient c) {
    String[] msg = c.getDataMessage();
    String[] xy = msg[0].split(",");
    float x = Integer.parseInt(xy[0]);
    float y = Integer.parseInt(xy[1]);
    balls.add(new Ball(x, y));
  }
View Full Code Here

Examples of bouncingballs.BouncingBalls.Ball

    // clear the screen
    background(255);

    // move and draw all the balls
    for (int i = 0; i < balls.size(); i++) {
      Ball ball = (Ball) balls.get(i);
      ball.calc();
      if (client.isOnScreen(ball.x - ball.d / 2, ball.y - ball.d / 2,
          ball.d, ball.d)) {
        ball.draw();
      }
    }

    // You can also read incoming messages in frameEvent
    /*if (c.messageAvailable()) {
View Full Code Here

Examples of com.ackgaming.entity.Ball

       bonusLifeBlockDamImg = new Image("res/blocks/bonus_blocks/bonus_life_block_damaged.png");
       bonusLifeItemImg = new Image("res/items/bonus_life.png");
       bonusGunItemImg = new Image("res/items/bonus_life.png");
      
       paddle = new Player(playerImg, playerGunImg);
       ball = new Ball(ballImg, gc.getFPS());
      
       bounce = new Sound("res/sounds/bounce.wav");
       brick = new Sound("res/sounds/brick.wav");
       lostLife = new Sound("res/sounds/lifelost.wav");
      
View Full Code Here

Examples of com.msjackiebrown.bouncingballs.Ball

     
    }
   
    public void addBall() {
     
      Ball b= new Ball();
      Thread t= new Thread(b);
     
      balls.add(numberBalls, b);
      threads.add(t);
     
View Full Code Here

Examples of com.msjackiebrown.bouncingballs.Ball

    // Update the info panel with current ball
   
    int index = ballindex.getSelectedIndex();
   
    if (index==-1) return;
    Ball  currentBall = BallPanel.getBalls().get(index);
    preview.repaint();
    radius.setValue(currentBall.getRadius());
    speed.setValue(currentBall.getSpeed());
   
    Color color = currentBall.getColor();
   
    jslRed.setValue(color.getRed());
    jslGreen.setValue(color.getGreen());
    jslBlue.setValue(color.getBlue());
   
View Full Code Here

Examples of com.msjackiebrown.bouncingballs.Ball

        super.paintComponent(g);
       
        this.setSize(300,300);
        int index = ballindex.getSelectedIndex();
       
        Ball  currentball = BallPanel.getBalls().get(index);
       
        int radius = currentball.getRadius();
       
        //Draw rectangle (yellow)
        g.setColor(Color.BLACK);
     
        int  x = this.getWidth()/2;
        int  y = this.getHeight()/2;
       

       
         g.setColor(currentball.getColor());
         g.fillOval(x-radius,y-radius,radius*2,radius*2);
       
       
     
 
View Full Code Here

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

Examples of crazyOrb.mechanics.Ball

        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

Examples of ini.trakem2.display.Ball

    final double[][] set2 = {{ 200, 200,   1, 45 },
                       { 240, 190,   0, 35 },
           { 220, 250,   1, 55 }};

    // 3 - Insert each set as a Ball object, each containing 3 x,y,z,r spheres:
    Ball b1 = addBallObject(project, set1, "Set 1");
    Ball b2 = addBallObject(project, set2, "Set 2");

    // 4 - Change colors and settings:
    b1.setColor(Color.green);
    b2.setColor(Color.magenta); // yellow is default color
    // NOTICE that the color cues will paint each individual ball red in the previous layer,
    // and blue in the next one -- the color is used to paint in the actual layer where it lives.
    // (Scroll through the stack to see the effect -- the color cues help in noticing whether
    // a ball already exists at the location in the previous or next slice/Layer).
    // You can TURN OFF color cues with the 'p' keyboard shortcut on a Display,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.