Immediate download Beginning NET Game Programming in VB NET 1st Edition David Weller ebooks 2024
Immediate download Beginning NET Game Programming in VB NET 1st Edition David Weller ebooks 2024
com
https://ebookname.com/product/beginning-net-game-
programming-in-vb-net-1st-edition-david-weller/
OR CLICK HERE
DOWLOAD NOW
https://ebookname.com/product/vb-to-vb-net-craig-utley/
ebookname.com
https://ebookname.com/product/fast-track-vb-net-1st-edition-rocky-
lhotka/
ebookname.com
https://ebookname.com/product/professional-asp-net-4-in-c-and-vb-1st-
edition-bill-evjen/
ebookname.com
https://ebookname.com/product/elementary-signal-detection-theory-1st-
edition-thomas-d-wickens/
ebookname.com
Windows XP Hacks Second Edition Preston Gralla
https://ebookname.com/product/windows-xp-hacks-second-edition-preston-
gralla/
ebookname.com
https://ebookname.com/product/amyloid-prions-and-other-protein-
aggregates-part-b-1st-edition-indu-kheterpal/
ebookname.com
https://ebookname.com/product/track-field-1-print-edition-gabrielle-
vanderhoof/
ebookname.com
https://ebookname.com/product/short-grammar-of-bulgarian-for-english-
speaking-learners-2-revised-edition-evgenia-antova/
ebookname.com
The 8 Biggest Mistakes People Make With Their Finances
Before and After Retirement 1st Edition Terence L. Reed
https://ebookname.com/product/the-8-biggest-mistakes-people-make-with-
their-finances-before-and-after-retirement-1st-edition-terence-l-reed/
ebookname.com
4010fm.qxd 8/20/04 2:33 PM Page i
Beginning .NET
Game Programming
in VB.NET
DAVID WELLER, ALEXANDRE SANTOS LOBÃO,
AND ELLEN HATTON
4010fm.qxd 8/20/04 2:33 PM Page ii
Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.
Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis,
Jason Gilmore, Chris Mills, Dominic Shakeshaft, Jim Sumser
Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 233 Spring
Street, 6th Floor, New York, New York 10013 and outside the United States by Springer-Verlag
GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219,
Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, email info@apress.com, or visit
http://www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall
have any liability to any person or entity with respect to any loss or damage caused or alleged to
be caused directly or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the
Downloads section.
4010fm.qxd 8/20/04 2:33 PM Page v
Contents at a Glance
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xv
Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi
v
4010fm.qxd 8/20/04 2:33 PM Page vii
Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xv
Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi
Contents
Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Space Donuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
viii
4010fm.qxd 8/20/04 2:33 PM Page ix
Contents
Moving On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .343
Habits to Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .344
Things We Neglected to Tell You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .348
Happy Trails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .350
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
ix
4010fm.qxd 8/20/04 2:33 PM Page xi
Foreword
BACK A FEW YEARS AGO I HAD AN IDEA. What if I could make the power of the
DirectX API available to the developers who were going to be using the new set
of languages and common language runtime that Microsoft was developing?
The idea was intriguing, and opening up a larger portion of the world to DirectX
was a goal I was only happy to endorse. Besides, what developer doesn’t want to
write games?
It seems that at least once a week I am answering questions directly regard-
ing the performance of managed code, and Managed DirectX in particular. One
of the more common questions I hear is some paraphrase of “Is it as fast as
unmanaged code?”
Obviously in a general sense it isn’t. Regardless of the quality of the Managed
DirectX API, the fact remains that it still has to run through the same DirectX API
that the unmanaged code does. There is naturally going to be a slight overhead
for this, but does it have a large negative impact on the majority of applications?
Of course it doesn’t. No one is suggesting that one of the top-of-the-line polygon
pushing games coming out today (say, Half Life 2 or Doom 3) should be written
in Managed DirectX, but that doesn’t mean that there isn’t a whole slew of games
that could be. I’ll get more to that in just a few moments.
The reality is that many of the developers out there today simply don’t know
how to write well-performing managed code. This isn’t through any shortcoming
of these developers, but rather the newness of the API, combined with not enough
documentation on performance, and how to get the best out of the CLR. For the
most part, we’re all new developers in this area, and things will only get better as
people come to understand the process.
It’s not at all dissimilar to the change from assembler to C code for games.
It all comes down to a simple question: Do the benefits outweigh the negatives?
Are you willing to sacrifice a small bit of performance for the easier development
of managed code? The quicker time to market? The greater security? The easier
debugging? Are you even sure that you would see a difference in performance?
Like I mentioned earlier, there are certain games today that aren’t good fits
for having the main engine written in managed code, but there are plenty of
titles that are. The top ten selling PC games just a few months ago included two
versions of the Sims, Zoo Tycoon (+ expansion), Backyard Basketball 2004, and
Uru: Ages Beyond Myst, any of which could have been written in managed code.
Anyone who has taken the time to write some code in one of the managed
languages normally realizes the benefits the platform offers pretty quickly. Using
xi
4010fm.qxd 8/20/04 2:33 PM Page xii
Foreword
this book, you should be able to pick up the beginning concepts of game devel-
opment pretty easily. It takes you through the simple sprite-based games, all the
way through a basic 3-D game implementation.
It’s an exciting time to be a developer.
Tom Miller
Lead Developer for the Managed DirectX Library,
Microsoft Corporation
xii
4010fm.qxd 8/20/04 2:33 PM Page xiii
Alexandre Santos Lobão got his first computer in 1981, when he was 12, and
immediately started to create simple games in BASIC. Since then, computers
have evolved massively, and so has he. Graduating with a bachelor’s degree in
computer science in 1991, Alexandre, together with six friends, founded that
same year a company that came to be known as a synonym for high-quality
services in Brasilia, Brazil: Hepta Informática.
Besides his excellent work in many software development areas, from
financial to telecommunication, he never forgot his first passion, and has always
worked as a nonprofessional game programmer. From 1997 to 1999 he also
worked at Virtually Real (http://www.vrealware.com), a virtual Australian amateur
game programming company founded by Craig Jardine.
At the end of 2000, Alexandre started searching for new horizons and,
leaving the company he helped to create, entered Microsoft as a consultant.
Looking at the new and extremely interesting possibilities offered by the .NET
Framework, he decided to take everything he’s learned over the last decade
and apply it to this new development platform.
xiii
4010fm.qxd 8/20/04 2:33 PM Page xiv
xiv
4010fm.qxd 8/20/04 2:33 PM Page xv
xv
4010fm.qxd 8/20/04 2:33 PM Page xvi
Credits
Figure 6-13: Serious Sam® ©2001 is a trademark of Croteam Ltd.
All rights reserved.
Figure C-4: PAC-MAN® ©1980 Namco Ltd. All rights reserved. Courtesy
of Namco Holding Corp.
Figure C-6: GALAGA® ©1980 Namco Ltd. All rights reserved. Courtesy of
Namco Holding Corp.
xvi
4010fm.qxd 8/20/04 2:33 PM Page xvii
Acknowledgments
To begin with, no development effort can be done without tools. There tools
were invaluable to me, and I heartily recommend them as “must have” tools:
I also want to thank those that kept me rocking while typing: Prodigy,
Ghetto Boys, Radiohead, Everclear, AC/DC, Christopher Parkening, Elliot Fisk,
Jimmy Buffett, Fleetwood Mac, the cast of the movie Chicago, Shakira, Norah
Jones, Alejandro Sanz, Juanes, and many, many more.
xvii
4010fm.qxd 8/20/04 2:33 PM Page xviii
Acknowledgments
Lastly on the list are the people who have quietly (or not-so-quietly) influ-
enced this book:
• My high school math teacher, Duane Peterson, who let me take a com-
puter programming class in spite of not knowing enough math—the result
of which inspired me to get a degree in computer science with a math
minor.
• My mom and dad, who put up with my intense passion for computers
during my adolescence, in spite of not having enough money to buy me
the mainframe system I wanted to put in our garage.
• My kids, Erich and Gretchen, and their mother, Nancy, who patiently
tolerated my passion for computer games for many years.
Lastly, I want to thank my girlfriend Ana, who has made some very gloomy
days for me much brighter, and who gave me all the support she could, even
though she was 2000 miles away most of the time.
—David Weller
xviii
4010fm.qxd 8/20/04 2:33 PM Page xix
Preface
I APPROACHED ALEXANDRE ABOUT A YEAR AGO to offer him comments on his first
book, .NET Game Programming with DirectX 9.0. After presenting him with a
rather long list of what I would have done differently, Alex graciously suggested
collaborating on a new book. We decided early in the process to reuse some
of the game examples from his book (specifically .Nettrix and .Netterpillars),
although some parts have been heavily modified. We did this for two reasons:
• The games are good, simple examples that can stand the test of time when
it comes to learning game programming. There was no sense creating a
different game just to convey the same concept.
• Writing different games from scratch would take time away from adding
newer games at the end of the book that challenged the beginner.
xix
Another Random Document on
Scribd Without Any Related Topics
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com