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

Username:   Password: 
 RegisterRegister   
 Collision effect
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Junaid2pac




PostPosted: Sat Jan 19, 2008 12:25 pm   Post subject: Collision effect

i have a game in which a ball is thrown and it hits a circulat object which is also moving (circular object is drawn by:
code:
e.drawOval();)
)
i also have a background in the back...now how would i make the circular object dissapear when the ball hits the circular object...
Note: I have already done the math for collision detection.
Sponsor
Sponsor
Sponsor
sponsor
HellblazerX




PostPosted: Sat Jan 19, 2008 2:20 pm   Post subject: Re: Collision effect

You could use a boolean to keep track of whether or not you need to draw the ball.
code:
if (notHit) {
     e.drawOval ();
}

and when your collision occurs, just set the boolean to false, and you won't draw the ball anymore
Display posts from previous:   
   Index -> Programming, Java -> Java 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: