Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Help! Pool game project.  (Read 2383 times)

0 Members and 1 Guest are viewing this topic.

Lucario1111

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Help! Pool game project.
« on: January 20, 2015, 11:23:08 pm »
Hi all,
Thanks for stopping by and reading this. (This is my first post so sorry if I should have formatted this differently)
I've been trying to work on a pool game for a project written in c++. So far I've gotten down part of the collision function. For most of the collisions, the balls bounce of each other at the right velocity, but sometimes, when they overlap, the balls circle each other and go into a weird twirling motion. A similar situation occurs when a ball is stuck in the side of the window, it vibrates back and forth but remains stuck in the border.
Code is in the attachment, any feedback would be greatly appreciated.

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Help! Pool game project.
« Reply #1 on: January 20, 2015, 11:27:52 pm »
I didn't watch your code.
You should separate your balls ( :-[ ) before applying the collision reaction to them.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Help! Pool game project.
« Reply #2 on: January 20, 2015, 11:47:26 pm »
« Last Edit: January 20, 2015, 11:55:10 pm by Jesper Juhl »

 

anything