Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualburnt_casadilla

Posted 13 August 2012 - 06:20 PM

[source lang="java"] public Rectangle getBallBounds() { return new Rectangle(this.x, this.y, 20, 20); } [/source]

this is called everytime the ball class is used?

can you explain why i should keep this in the ball class? why would it be any different if it was outside of the class?

im thinking i should put it in the updateGame method and in the if method after the new ball is created every three seconds

[source lang="java"] if (timeSinceLastNewDot >= NEW_DOT_FREQ) { int newX = randomNumber(); int newY = randomNumber(); debugPrint("New dot created at x:" + newX + ", y:" + newY + "."); BALLS.add(new Ball(newX, newY, 20, 20)); getBallBounds(); timeSinceLastNewDot = 0; }[/source]

so maybe something like this?

#1burnt_casadilla

Posted 13 August 2012 - 06:17 PM

[source lang="java"] public Rectangle getBallBounds() { return new Rectangle(this.x, this.y, 20, 20); } [/source]

this is called everytime the ball class is used?

can you explain why i should keep this in the ball class? why would it be any different if it was outside of the class?

PARTNERS