Im following a book on game programming.... but the guy uses numbers which I can't understand why he has them and how they relate. He doesn't explain his code at all. In particular,
This code sets a bitmap image of a saucer to the middle of the screen.Code:// Set the initial saucer position and speed - Middle of the screen g_iSaucerX = 250 - (g_pSaucer->GetWidth() / 2); g_iSaucerY = 200 - (g_pSaucer->GetHeight() / 2);
Now, GetWidth simply returns m_iWidth. This is set to 640 and 480 for the height.
So, in trying to understand this I changed g_iSaucer to -70: what I believed the calculation to be equal to. This caused the image to begin at the extreme left of the window
Anyone know what the 250 is?
Also, when I do programmes with console I do a quick cout << to display any variables I'm unsure what they contain at a particular moment. How can I do the equivalent in the Win32 API. this would be a very handy technique for understanding code and also debugging.
Thanks for your time