Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualburnt_casadilla

Posted 12 August 2012 - 08:04 PM

wow ran into an issue already -.-

[source lang="java"] public Rectangle getMainBallBounds() { return new Rectangle(mainBall.xpos, mainBall.ypos, 10, 10); }[/source]

the position of my main ball is always going to be changing. so do i need a while loop or a for loop here to account for the changing xpos and ypos variables?

nevermind fixed that too. i should stop asking questions before i actually try to figure things out lol.

so for collision. oh boy.

-1. should i store each rectangle created as an object for now? before i work on the array part when thatd be hard to do lol
1. create a method checkCollision(). i dont think it needs to return anything but i could be wrong
2. (if (mainBallRectangle.intersects(fixedBallRectangle))
3. if its true, set mainBall.xspeed = 0 and same with the yspeed

will this work?

#1burnt_casadilla

Posted 12 August 2012 - 07:48 PM

wow ran into an issue already -.-

[source lang="java"] public Rectangle getMainBallBounds() { return new Rectangle(mainBall.xpos, mainBall.ypos, 10, 10); }[/source]

the position of my main ball is always going to be changing. so do i need a while loop or a for loop here to account for the changing xpos and ypos variables?

PARTNERS