
-----------------------------------
mattparliament
Wed Dec 19, 2007 9:32 am

I need help with my game.......(breakout)
-----------------------------------
:shock: i need help to find out how to get the block in my game to disapear when i hit it with the ball, also to get the ball to bounce of it. PLEASE HELP

-----------------------------------
Euphoracle
Wed Dec 19, 2007 3:33 pm

RE:I need help with my game.......(breakout)
-----------------------------------
Sure.  To make the block disappear, have a boolean true/false for each block.  If it is true, draw it and do hit detection, which leads to our next point.  Each frame, check if the ball has collided with a block.  If it has, reverse the direction of the ball and set the boolean we discussed earlier for the block to false.  When the ball hits a wall, do the same thing, reverse the direction (but do nothing to any booleans).

For help with collision detection see [url=http://compsci.ca/v3/viewtopic.php?t=13661&highlight=collision]this.
