Chapter 2. Programs, Data, and Pretty Colors

In this chapter, you will

  • Explore how games actually work.

  • See how data is stored in a program.

  • Discover how colors are managed on computers.

  • Find out about classes and methods.

  • Write some code that controls color.

  • Write some code that makes decisions.

  • Create a funky color-changing mood light.

Introduction

You now know how to create a Microsoft XNA program and run it. Your program only turns the screen blue, but you could call it a start. Next, you are going to figure out how game programs are constructed. Then you’ll play with colors and find out how XNA stores color information and how C# stores data.

Get Microsoft® XNA® Game Studio 4.0: Learn Programming Now! now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.