Game Development for Xbox 360, PC + Windows Phone 7

Chapter 7 - Pg 136 - Reference to ButtonType

rated by 0 users
Answered (Verified) This post has 1 verified answer | 1 Reply | 2 Followers

Top 25 Contributor
3 Posts
slooksterpsv posted on 3 Mar 2010 2:07 AM

Hi Chad,

Great book, I love it and have recommended it to others - I have another, but it didn't explain things like this book does ( Professional XNA Programming by Benjamin Nitschke ).

Anyways I think I found an error in the book, on page 136 in the  Update Method it states:

if (gamePadHandler.WasButtonPressed(0, ButtonType.Back))

  Game.Exit();

Should ButtonType.Back be: Buttons.Back? I've changed it to that and it seems to work (don't have an XBOX to test), but ButtonType is not a known type.

Thanks,

 

Shawn B.

Answered (Verified) Verified Answer

Top 10 Contributor
Male
135 Posts

First, thanks for the compliment on the book.  I'm glad you are liking it.  I hope it helps.

Second, sorry for taking so long to respond.

Third, you are exactly right.  It should be Buttons.Back.  I'll update the errata to have the same text I have for Chapter 9 put into Chapter 7:

With the change from XNA Game Studio 1.0 Refresh to XNA Game Studio 3.0, Microsoft included a enumeration type for buttons. In the original book we created our own type InputHandler.ButtonType. The built in enum type is simply Buttons. The code should reference Buttons instead of InputHandler.ButtonType.

Thanks for bringing this to my attention!

Chad

Page 1 of 1 (2 items) | RSS
© 2011 Chad Carter. All rights reserved.