Search:

Type: Posts; User: jusjus7

Search: Search took 0.12 seconds.

  1. Re: need to randomly change the size of programs balls

    i have managed to do it thanks for your help

    Random random = new Random();
    HashSet<BouncingBall> balls = new HashSet<BouncingBall>();
    for(int i=0; i<numberOfBalls; i++) {
    ...
  2. Re: need to randomly change the size of programs balls

    int ballDiameter = 56+59*i; < thats where the size is changed

    i holds the variable
  3. Re: need to randomly change the size of programs balls

    yes thats the size

    int ballDiameter = 56+59*i; is changes the size of the ball but its not random



    Random random = new Random();
    HashSet<BouncingBall> balls = new...
  4. Re: need to randomly change the size of programs balls

    size is held in

    class bouncingball



    public BouncingBall(int xPos, int yPos, int ballDiameter, Color ballColor,
    int groundPos, Canvas drawingCanvas)
    {
    ...
  5. Re: need to randomly change the size of programs balls

    Ok sorry, below are my three classes. I have been able to get the balls to randomly bounce but not to randomly change size.



    import java.awt.*;
    import java.awt.geom.*;
    import...
  6. Re: need to randomly change the size of programs balls

    Can anybody please help? really stuck
  7. need to randomly change the size of programs balls

    I am starting to learn java at home and one of the tasks in the book is to create a program which randomly changes the size of balls which are bouncing off the screen, but all i seem to be able to do...
  8. need to randomly change the size of programs balls

    I am starting to learn java at home and one of the tasks in the book is to create a program which randomly changes the size of balls which are bouncing off the screen, but all i seem to be able to do...
Results 1 to 8 of 9