Learn VB NET Through Game Programming 1st Edition Matthew Tagliaferri (Auth.)download
Learn VB NET Through Game Programming 1st Edition Matthew Tagliaferri (Auth.)download
https://ebookultra.com/download/learn-vb-net-through-game-
programming-1st-edition-matthew-tagliaferri-auth/
https://ebookultra.com/download/beginning-asp-net-2-0-in-vb-2005-from-
novice-to-professional-apr-2006-1st-edition-matthew-macdonald/
https://ebookultra.com/download/murach-s-asp-net-4-5-web-programming-
with-vb-2012-training-reference-5th-ed-edition-boehm/
Build Your Own ASP NET Website Using C VB NET 1st Edition
Zak Ruvalcaba
https://ebookultra.com/download/build-your-own-asp-net-website-using-
c-vb-net-1st-edition-zak-ruvalcaba/
https://ebookultra.com/download/vb-net-for-developers-sams-white-
book-1st-edition-keith-franklin/
Pro Silverlight 3 in VB 2nd ed. Edition Matthew Macdonald
https://ebookultra.com/download/pro-silverlight-3-in-vb-2nd-ed-
edition-matthew-macdonald/
https://ebookultra.com/download/pro-silverlight-4-in-vb-3rd-ed-3rd-
edition-matthew-macdonald/
https://ebookultra.com/download/programming-asp-net-ajax-1st-edition-
christian-wenz/
https://ebookultra.com/download/visual-c-net-programming-1st-edition-
harold-davis/
https://ebookultra.com/download/real-world-enterprise-reports-using-
vb6-and-vb-net-1st-edition-carl-ganz-jr-auth/
Learn VB NET Through Game Programming 1st Edition
Matthew Tagliaferri (Auth.) Digital Instant Download
Author(s): Matthew Tagliaferri (auth.)
ISBN(s): 9781590591147, 1590591143
Edition: 1
File Details: PDF, 13.07 MB
Year: 2003
Language: english
learn VB .NET Through
Game Progranvning
Matthew Tagliaferri
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any
information
means, electronic or mechanical, including photocopying, recording, or by any information
storage or retrieval system, without the prior written permission of the copyright owner and the
publisher.
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
benefit infringement of the trademark.
Editorial Board: Dan Appleman, Craig Berry, Gary Cornell, Tony Davis, Steven Rycroft, Julian
Skinner, Martin Streicher, Jim Sumser, Karen Watterson, Gavin Wray, John Zukowski
KimWimpsett
Copy Editor: Kim Wimpsett
Janet Vail
Production Editor: JanetVail
Manufacturing
Manufacturing Manager: Tom Debolsld
Debolski
phone I-S00-SPRINGER,
In the United States: phone 1-800-SPRINGER, email
email orders@springer-ny.com. orvisit
orders@springer-ny.com, or visit
http://www.springer-ny.com. Outside the United States: fax
http://www.springer-ny.com. fax +49
+49 6221
6221 345229,
345229, email
email
orders@springer . de, or visit http://www.springer.de.
orders@springer.de, http://www.springer.de.
information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219,
For information
94710. Phone
Berkeley, CA 94710. Phone 510-549-5930,
510-549-5930, fax
fax 510-549-5939,
510-549-5939,email
email info@apress.com, orvisit
info@apress.com, or visit
http://www.apress.com.
v
Contents
About the Author ................................................... xi
About the Technical Reviewer .................................... xii
Acknowledgments ................................................... xiii
Introduction ....................................................... xv
vii
Contents
viii
Contents
ix
About the Author
matt tagliaferrl has been developing soft-
ware since his high school obtained its
first computers-six TRS-80 Model 3s-in
1982. matt (who prefers his name in
lowercase) has developed software in sev-
eral industries, including retail, insurance,
corporate finance, and trucking before
(somewhat miraculously) landing a senior
analyst position with the Cleveland
Indians baseball organization. matt has
been with the Indians for six years and is now the manager of application
development.
Currently, matt lives in the Cleveland area with his wife and two daughters.
He enjoys collecting The Simpsons action figures and "family stuff" such as
American Idol and Friday Pizza Nights.
xi
About the Technical
Reviewer
MIKE BURGESS started writing software on computers back when they took up
whole rooms and had less memory than an average digital watch today. He has
worked for small to large corporations (including Microsoft) and has been work-
ing with Visual Basic since the beta of version 1. He's written many different types
of software including small business accounting and inventory, real estate, emer-
gency management, corporate communication, multimedia, medical diagnosis,
and some hush-hush stuff for the government.
He currently resides in northern Utah with his wife and five (yes, five) chil-
dren. He enjoys Family Game Night, Mountain Dew, and a good round of Ghost
Recon with his kids and brothers.
xii
Acknowledgments
WRITING A BOOK IS DEFINITELY not a solo project-and there are numerous people
to thank for the opportunity and the work put into this project. I'd like to thank
the entire Apress team. This is my first Apress title, and I've found it to be a first-
class organization. Individually, my list of acknowledgments probably reads like
the internal Apress organizational chart: thanks to Gary Cornell for listening to
and shaping my initial pitch, thanks to Dan Appleman for some overall direction
in finding the correct audience, and thanks to Laura Cheu and Nate McFadden
for serving as project managers and keeping the project on track. Mike Burgess
served as technical editor for the book and did a great job not only making sure
the code was complete and that everything compiled but also making sugges-
tions to help improve code clarity and readability. Kim Wunpsett filled the role of
editor, keeping my i's dotted and my gerunds gerunding. Finally, Beth Christmas
filled a multitude of roles from making sure I had the correct screen-capture soft-
ware to getting me advance copies of Visual Studio. I thank all of them for turning
a simple idea into the organized pile of pages you now hold in your hands.
On the home front, no project gets far without the understanding of my wife,
Janet, who has to put up with me running to the computer to check email as soon
as I get home from work and with the clack clack of the keyboard as she tries to
read every evening. I hope she doesn't need to read this to know how much her
love and support mean to me.
xiii
Introduction
A FEW YEARS AGO, Microsoft raised a few eyebrows (my own included) when it
announced that the next version of Visual Basic (VB) would not be backward
compatible with the current version, VB 6. There were many valid reasons for
breaking the compatibility, but many people still thought Microsoft was taking
a considerable gamble. After all, there were thousands of VB programmers crank-
ing out millions of lines of code in the modem workforce, and suddenly Microsoft
was announcing that this mountain of code would someday be considered "old"
technology.
xv
Introduction
to learn anything. A program too large doesn't work, either-you end up spend-
ing too much time bogged down in the complexity of the task, which takes away
time from learning the features of the language. like Goldilocks, you're looking
for the program not too small, not too big, but instead "just right."
I discovered a few years ago that the "small game" program fit nicely into
the "just right" category for learning the basics of a programming language.
A small game is one that fits on a single screen and can usually be played by
a single player in a few minutes. Examples of a small game include card games,
dice games, and some simple board games. Many qualities make programs
such as these good learning subjects. Programs of this type usually need to keep
track of one or more types of game piece, and these pieces are often required to
change state (such as a die rolling or a board element changing color). These
game elements often come in groups (52 cards in a deck, five dice for Yahtzee) ,
so you'll have to learn how the language stores a group of similar elements. The
user interface requirements of such games are usually more interesting (and
therefore more challenging) than the usual button/listboxl combo box interface.
Finally, when you've succeeded and completed the program, you've got a fun
game to play.
The goal of this book is to teach you how to get started programming in VISual
Basic .NET by developing games. This book doesn't intend to be a complete treatise
of all the features and capabilities of this latest version ofVB. Instead, it provides
a series of example programs that illustrate basic features of the language and begins
the huge task of introducing you to the contents of the .NET Framework. In addition,
I introduce one more important programming concept-the concept of design. Now
that object-oriented languages are more common, people have found that the vari-
ous objects in a program can be designed to interact with each other in different
ways; these interactions can make the program more or less complex or more or less
adaptable to future features or enhancements. To illustrate the importance of design
on a program, I've taken the time to walk you through the development process of
several of these programs rather than simply presenting you with the final version
of the game. By learning how to solve a program one way, then improving upon that
design in a second or third version of the program, you'll begin to recognize when your
own designs might be headed down a wrong path and some redesign is in order.
xvi
Introduction
are looking to update your skill set to something more modem. Or perhaps
you've picked up software development as a secondary skill at your job (you're
the office "Excel macros guru"), and now you want to learn something more for-
mally. Whatever the case, my assumption is that as you crack open Chapter 1,
"Developing Your First Game," you've written programs in some other language
so that you have a jumping-off point. Specifically, the following concepts should
be familiar to you:
• Flow statements such as If .. Then •. Else blocks, For loops, and While
statements
• The use of procedures and functions and how to get information into and
out of them
Getting Up to Speed
If the previous little review list gives you a queasy feeling, or you simply think you
might need a refresher on some of these topics, then you'll be happy to know that
Appendix A, "The Basics of Visual Basic" contains some introductory material.
Specifically, it covers these topics while describing how to write a simple Visual
Basic .NET program. Becoming familiar with the topics in the appendix should
give you enough background to dive into Chapter 1, "Developing Your First Game,"
and start the game writing.
xvii
Introduction
BMPStitch AppendixC
CellularAutomata ChapterS
Cellul~tomata~thSave Chapter 9
DicePanel Chapter 2
DirectXDemo ChapterS
FirstApplication Appendix A
GarbageDemoOne Chapter 9
GarbageDemoTwo Chapter 9
GuessTheDieRoll Chapter 1
GuessTheDieRoll2 Chapter 2
GuessTheDieRoll3 Chapter 2
lnterfaceEbGinlple Chapter 6
NetReversi Chapter 7
NineTiles Chapter 3
PCOpponent Chapter 6
PolymorphismEbGinlple ChapterS
ShapeTileGames Chapter 4
SpaceRocks ChapterS
ThreadParametersOne Chapter 9
ThreadParametersThree Chapter 9
ThreadParameters1\vo (broken) Chapter 9
Yahtzee Bonus game
xviii
Exploring the Variety of Random
Documents with Different Content
“The reader gets the impression that he is listening to a man
talking to himself.”
+ Ind. 58: 786. Ap. 6, ‘05. 300w.
—
“As a study in modern phases this story must be considered
something more than remarkable. The phases themselves are
more than remarkable, the motive almost fantastic in spite of
the realistic modern London setting. The yeast of fate brews
and works in the whole, and makes of these elements a climax
so melodramatic as to seem almost inspired. But it is
melodrama pathologically inevitable. One may read the books
and ponder on the meaning of faith, science, and common
sense, or one may think chiefly of the story—one of humanity
probed pretty deep—one somewhat daringly planned, but one
which shows strength and a seeing eye.”
+ N. Y. Times. 10: 70. F. 4, ‘05. 520w.
“A powerful story.”
+ R. of Rs. 31: 120. Ja. ‘05. 50w.
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.
ebookultra.com