p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 (http://p2p.wrox.com/forumdisplay.php?f=325)
-   -   Code differences (http://p2p.wrox.com/showthread.php?t=57542)

afharris_83 May 6th, 2007 07:10 PM

Code differences
 
I am noticing differences between the downloaded code I have from the Wrox site and the code that is present in the book; am I just using the wrong version? I have one VS 2005 session open with the downloaded project for reference and I am working through the book and typing everything in another VS session to build the Pong game. I find that a lot of functions are set up differently in code from what the book states...an example would be providing ints where the function we've created expects a Rectangle to be created and provided (and as is executed in the downloadable code.) Another would be GameLifesRect vs. GameLivesRect and a few other small things.

I've been working on the stuff for most of the day...am I just tired and missing something blatantly obvious? Thanks in advance for any help.

cstein May 6th, 2007 11:01 PM

No, you're not just tired. There are definitely a lot of differences. I've already submitted a few different issues to the Errata page for this book. I got the Pong game working with a few minor modifications to the code in the book without using the downloaded source (other than the images and sounds). However, in the third chapter where he talks about XNA Breakout, you HAVE to download the source code from the web site and use it as the code for many of the helper classes and much of the game aren't listed at all.


afharris_83 May 7th, 2007 06:45 AM

Well I'm glad it's not my eyes going bad [8D]

I think my approach is going to switch to using the downloaded code as my code reference, and when I get to a function (TestMenuSprites, for example) instead of reading and typing from the book I'll just find it in the download and use that instead.

ijoemomma May 7th, 2007 05:39 PM

If im not mistaken, the author has recently updated the code found on this site. From what I understand, it had to do with the usual bug fixes, changes caused by the refresh and that sort of thing.


abi.exdream.com May 7th, 2007 11:09 PM

Yes, I'm sorry about that, but most of the early code for the book was written a long time ago even before XNA 1.0 was at (some of it even before the XNA Beta 2 was out) and there were a lot of changes since then. Most importantly I got a lot of feedback on the way content is loaded and I changed it in the last code update. Now all the Content load and unload events are used correctly, before that all that code was in the Initialize method. I also fixed a few bugs and improved some code, but I have not updated the source code in the book yet. I will fix this when I get the book myself (still waiting here in Germany while all you guys are already reading it in the US), not sure myself which source code was in the book. Thanks for the Errata submissions btw.

If you got more problems compiling code or understanding the differences that happend due all those changes, just ask. I'm happy to help with that.

http://abi.exdream.com

afharris_83 May 8th, 2007 10:14 AM

Thanks :) I understand about the code differences; I have yet to read any programming book where all the code in the book matched what was on CD or downloadable. More importantly I just wanted to make sure I wasn't misunderstanding what I was reading or missing something obvious.

Good book so far though; I'm on to the 3D sections and building my first 3D apps.


All times are GMT -4. The time now is 04:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.