User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 402,024 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,416 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.

negative coordinates?

Join Date: Jun 2005
Location: Troy
Posts: 1,277
Reputation: Rashakil Fol has a spectacular aura about Rashakil Fol has a spectacular aura about 
Rep Power: 7
Solved Threads: 36
Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Salamander Man

Re: negative coordinates?

  #2  
May 4th, 2007
It seems that you're using an unsigned integer to represent your coordinates. When you decrement an unsigned integer, such as 0, instead of getting -1, you get the highest possible value the integer can represent.

In fact, if you're getting 32 thousand, you're probably getting errors related to the comparison of integers -- you're probably representing your paddle coordinates with unsigned integers while your mouse coordinates are signed, or maybe the other way around. I'm guessing your paddle coordinates are rolling over from 0 to 65535 and then getting decremented 32 thousand times ... or something like that.
Last edited by Rashakil Fol : May 4th, 2007 at 5:50 pm.
Reply With Quote  
All times are GMT -4. The time now is 10:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC