Author Topic: Experimental Lab  (Read 145550 times)

0 Members and 1 Guest are viewing this topic.

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 22
  • -Receive: 25
  • Posts: 195
Re: Drag and Drop Concept
« Reply #90 on: December 26, 2012, 06:11:22 AM »
Quote
I haven't looked at the code, but could you do something like:

Well that's pretty much what I'm doing. I'm not having a problem with the coding so much as having concerns with performance. Run the program and see if you have the same problem with tracking that I am. I think it might just be my slow computer but it could very well be poorly written code. Thanks.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Experimental Lab
« Reply #91 on: December 26, 2012, 10:32:35 AM »
Quote
I haven't looked at the code, but could you do something like:

Well that's pretty much what I'm doing. I'm not having a problem with the coding so much as having concerns with performance. Run the program and see if you have the same problem with tracking that I am. I think it might just be my slow computer but it could very well be poorly written code. Thanks.

Well, you can just simply make the ball being rendered to the mouse screen coords, it's after all rendered on screen. Then, when the mouse is lifted you calculate distances from the roids.

The balls are bugging out because it's actually checking the distance per tick and if it's outside it won't do anything for you.
You should just store a number variable for the current active ball and move it around without checking the current distance from the mouse.

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 22
  • -Receive: 25
  • Posts: 195
Re: Experimental Lab
« Reply #92 on: December 26, 2012, 01:16:38 PM »
Quote
Well, you can just simply make the ball being rendered to the mouse screen coords, it's after all rendered on screen. Then, when the mouse is lifted you calculate distances from the roids.

The balls are bugging out because it's actually checking the distance per tick and if it's outside it won't do anything for you.
You should just store a number variable for the current active ball and move it around without checking the current distance from the mouse.

Alright! I changed the code to get rid of the "checking distance per tick" and that seems to have corrected the problem. This also solved another problem I was having with the mouse picking up every ball it rolled over!

Thanks you guys!

Corrected code attached...
« Last Edit: December 26, 2012, 01:27:52 PM by Lost Seedling »