Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I need help with my game.......(breakout)
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mattparliament




PostPosted: Wed Dec 19, 2007 9:32 am   Post subject: I need help with my game.......(breakout)

Shocked 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
Sponsor
Sponsor
Sponsor
sponsor
Euphoracle




PostPosted: Wed Dec 19, 2007 3:33 pm   Post subject: 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 this.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: