Programming Tip of the Day
April 5th, 2007
And now for the Programming Tip of the Day. The first piece of code is not equal to the second piece of code. Can you spot the difference? It took me about a half hour to realize that this was the reason my units were jumping around and not moving smoothly.
Good
(int)((myUnit.PosX - myCamera.TileX) * Map.TileWidth)
Bad
((int)(myUnit.PosX - myCamera.TileX) * Map.TileWidth)
1 Response to “Programming Tip of the Day”
Sorry, comments are closed for this article.
April 5th, 2007 at 11:23 AM I found it in ten seconds! I'm a natural born coder... :) And I'm awesome.