Learn 2D Game Development with C#

Book description

2D games are hugely popular across a wide range of platforms and the ideal place to start if you're new to game development. With Learn 2D Game Development with C#, you'll learn your way around the universal building blocks of game development, and how to put them together to create a real working game.

C# is increasingly becoming the language of choice for new game developers. Productive and easier to learn than C++, C# lets you get your games working quickly and safely without worrying about tricky low-level details like memory management. This book uses MonoGame, an open source framework that's powerful, free to use and easy to handle, to further reduce low-level details, meaning you can concentrate on the most interesting and universal aspects of a game development: frame, camera, objects and particles, sprites, and the logic and simple physics that determines how they interact.

In each chapter, you'll explore one of these key elements of game development in the context of a working game, learn how to implement the example for yourself, and integrate it into your own game library. At the end of the book, you'll put everything you've learned together to build your first full working game! And what's more, MonoGame is designed for maximum cross-platform support, so once you've mastered the fundamentals in this book, you'll be ready to explore and publish games on a wide range of platforms including Windows 8, MAC OSX, Windows Phone, iOS, Android, and Playstation Mobile. Whether you're starting a new hobby or considering a career in game development, Learn 2D Game Development with C# is the ideal place to start.

What you'll learn

  • Know your way around the world of game design and the process of designing a game from scratch.

  • Understand the basic architecture of a 2D game engine and develop your own game library.

  • Work with the MonoGame framework and use it to build your own 2D interactive games.

  • Learn and implement simple in-game pseudo autonomous behaviors.

  • Understand and implement the math and physics underlying realistic game interactions.

  • Give your game impact with graphic effects, and audio and special effects.

  • Who this book is for

    This book is perfect for game enthusiasts, hobbyists, and anyone who is interested in building interactive games but is unsure of how to begin. It assumes no background in computer graphics or game development, but readers should be familiar with C# or another object-oriented language.

    Table of contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Authors
    6. About the Technical Reviewer
    7. Acknowledgments
    8. Introduction
    9. CHAPTER 1: Introducing 2D Game Development in C#
      1. Downloading and Installing Development Tools
      2. What Is Covered in This Book?
      3. What Is Not Covered in This Book?
      4. Technology References
    10. CHAPTER 2: Getting to Know the MonoGame Framework
      1. The Visual Studio Development Environment
      2. Understanding the MonoGame Framework
      3. The Microsoft.Xna.Framework.Game Class
      4. Adding, Drawing, and Controlling Content
      5. Wrapping Game Controller with the Keyboard
      6. Summary
      7. Quick Reference
    11. CHAPTER 3: 2D Graphics, Coordinates, and Game State
      1. Introduction
      2. The Game Window
      3. Textured Primitives
      4. Coordinate System and Camera
      5. Font Output
      6. A Simple Game Object
      7. Simple Game State
      8. Summary
      9. Quick Reference
    12. CHAPTER 4: Getting Things Moving
      1. Rotating textures
      2. Vectors
      3. Front direction
      4. Game objects
      5. Chasers
      6. Summary
      7. Quick reference
    13. CHAPTER 5: Pixel-accurate collisions
      1. Pixel-accurate collision
      2. General pixel collision
      3. Simple physics
      4. Summary
      5. Quick reference
    14. CHAPTER 6: Game object states and Semiautonomous Behaviors
      1. Review of finite state machines
      2. Creating a spinning arrow
      3. Adding many spinning arrows
      4. Creating a patrol enemy
      5. Implementing smooth turning
      6. Patrol that chases
      7. Creating many enemies
      8. Summary
      9. Quick reference
    15. CHAPTER 7: Sprites, Camera, Action!
      1. Sprite animation
      2. Sprite collision
      3. Moving and zooming the camera
      4. Adding audio
      5. Summary
      6. Quick reference
    16. CHAPTER 8: Particle Systems
      1. Particle systems
      2. Particle emitters
      3. Summary
      4. Quick reference
    17. CHAPTER 9: Building Your First 2D Game
      1. Simple Game: Fish Food
      2. Fish Food Game Design
    18. Index

    Product information

    • Title: Learn 2D Game Development with C#
    • Author(s):
    • Release date: December 2013
    • Publisher(s): Apress
    • ISBN: 9781430266044