C# and Game Programming
eBook - ePub

C# and Game Programming

A Beginner's Guide

Salvatore A. Buono, Salvatore A. Buono

Share book
  1. 532 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

C# and Game Programming

A Beginner's Guide

Salvatore A. Buono, Salvatore A. Buono

Book details
Book preview
Table of contents
Citations

About This Book

The second edition of C# and Game Programming offers the same practical, hands-on approach as the first edition to learning the C# language through classic arcade game applications. Complete source code for games like Battle Bit, Asteroid Miner, and Battle Tennis, included on the CD-ROM, demonstrates programming strategies and complements the comprehensive treatment of C# in the text. From the basics of adding graphics and sound to games, to advanced concepts such as the.Net framework and object-oriented programming, this book provides the foundations for a beginner to become a full-fledged programmer. New in this edition: - Supports DirectX 9.0 - Revised programs and examples - Improved frame rate for game examples

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is C# and Game Programming an online PDF/ePUB?
Yes, you can access C# and Game Programming by Salvatore A. Buono, Salvatore A. Buono in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación de juegos. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781351989343
Programming Basics
I
Chapter One
C# from the Beginning
1
Everything should be made as simple as
possible, but not simpler
.”
–Albert Einstein
This chapter covers the basic aspects of the C# language including its history, compilers, algorithms, variables, and the use of the Base Class Library. Each section is designed to facilitate a quick and easy introduction and to ensure a strong foundation in programming and problem solving. Special attention was placed on what a new programmer needs to know and/or might be confused about; the sections can, however, be covered quickly. There are a few sections set aside to cover history and theory, but the core of this chapter is about programming. Two sections promote good programming habits and there is a section on runtime, programming, and compiler errors (recommended reading even if you don’t get into trouble). If you’ve skimmed the lessons, you know that this first chapter doesn’t include any games, but don’t let that fool you. All of the concepts covered here are just as important for games as they are for business and/or math related topics.
An Overview of the C# Language
C# is a high- or mid-level programming language (and just in case you didn’t know, a programming language is the collection of words, phrases, and syntax rules used to communicate with the computer). Although there are many high-level programming languages (BASIC, JAVA, FORTRAN, Pascal, Lisp, ADA, Modula-2 and Logo), few have reached the popularity of the original C and C++ languages. C and C++ have been used to create everything from operating systems and word processing packages to compilers for other high-level languages. C and C++ have been the programming languages of choice for more than 50 percent of all programming applications, and with their advances in object-oriented programming and Internet applications, both Managed C++ and C# are sure to fuel the popularity of C languages well into this new millennium.
A Little History on the Cs
C was developed in the 1970s by Dennis Ritchie while he worked at AT&T Bell Laboratories. Before C, there was a language called B developed by Ken Thompson. While there was an A language, B was actually developed from Basic Combined Programming Language (BCPL), which was developed from a combination of two other languages, namely CPL and Algol60. C++’s object-oriented portions are attributed to still another language known as Simula67. CPL begot BCPL; BCPL begot B; B begot C; C begot C++; and C++ begot C#. In 1979, Bjarne Stroustrup (also at AT&T Bell Laboratories) developed the first version of C++ to be an enhanced version of the C language (initially referred to as C with classes). C++ was significantly enhanced with the addition of the Standard Template Library (STL) developed by Alexander Stepanov and Meng Lee at Hewlett-Packard. The STL was based heavily on previous work done by both Stepanov and Musser, from Rensselaer Polytechnic Institute.
Both C and C++ spread quickly in power and use, but eventually all the added features and expansions lead to incompatibilities and frustrations. Two standards were created, first with the American National Standards Institute (ANSI) C standard of 1983, and then the American National Standards for Systems Information and International Standards Organization (ISO) C/C++ standards of 1998 (Note: C was also updated in this second standard). The 1998 ANSI/ISO standard is generally referred to as Native C++, while Microsoft’s .Net Extensions are known as Managed C++. C# was also standardized with its first release under what is known as the 2001/2002 ECMA certified standard.
C# was developed by a team of Microsoft programmers led by chief architect Anders Hejlsberg. It is intended to supplement the development of applications required for both stream users and intranet/internet programmers alike. C# is definitely one of the most sophisticated languages ever developed, and similar to the entire .Net architecture, it will alter the way programmers think about programming for many years to come. Hejlsberg was also responsible for the development of Microsoft’s Visual J++, Turbo Pascal, and Delphi, for which he finally received the Dr. Dobb’s Journal Award for Excellence in Programming early in 2001. For further information on the history of Turbo Pascal, Visual J++, and the Dr. Dobb’s Journal Award, you should consult your local library… now let’s get back to business.
Image
As you can see, C# evolved from the simpler languages.
Hey, I thought it was created by a programmer.
What is the .Net Framework?
The .Net framework is a multitasking, class-based programming library and interface that allows for both the interoperable exchange and execution of data. As a library, the .Net base classes are as powerful as the traditional Windows API function set, but have the added advantage of being completely object-oriented. Object-oriented programming (as explained throughout this book) is a practical method used to develop programs that promotes both the reusability and reliability of code. The .Net runtime (also known as the Common Language Runtime or CLR) serves as a shell or intermediate environment that assists the operating system with program execution(s).
The .Net framework also allows for program interoperability, requiring a Common Type System (CTS) governed through the Intermediate Language commonly known as Microsoft’s Intermediate Language (MSIL) and/or the Common Intermediate Language (CIL). I...

Table of contents