How to get direction after collision of an image by another fix image

I am making a game in which ball collid with another fix object ball

Page 1 of 1

3 Replies - 1155 Views - Last Post: 16 November 2010 - 09:14 AM Rate Topic: -----

#1 Guest_Anish Jangra*


Reputation:

How to get direction after collision of an image by another fix image

Posted 15 November 2010 - 11:21 PM

Hi All

I am making a game in which ball collid with another fix object ball only first ball should bounce back , i have only speed of the ball, how can i get the direction of the ball,plz tell me what matter required to get the direction of the ball ,how ball can be bounce back after collision with a fix body...
Is This A Good Question/Topic? 0

Replies To: How to get direction after collision of an image by another fix image

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14092
  • View blog
  • Posts: 56,460
  • Joined: 12-June 08

Re: How to get direction after collision of an image by another fix image

Posted 15 November 2010 - 11:33 PM

Easily it could be done with making it a right angle to the hit. So flip an X or Y (depending on the side it was hit) and keep the motion going that way. Give or take due to momentum loss.

This post has been edited by modi123_1: 15 November 2010 - 11:33 PM

Was This Post Helpful? 0
  • +
  • -

#3 Guest_Anish Jangra*


Reputation:

Re: How to get direction after collision of an image by another fix image

Posted 16 November 2010 - 01:09 AM

Thanks for reply,

can u give me some code to do this , i have only the speed of the ball......
Was This Post Helpful? 0

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14092
  • View blog
  • Posts: 56,460
  • Joined: 12-June 08

Re: How to get direction after collision of an image by another fix image

Posted 16 November 2010 - 09:14 AM

You don't have the direction the ball is moving?

I can't give you the code because I don't know how you wrote your ball's movement...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1