O'Reilly logo

C++ Game Development Primer by Bruce Sutherland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    6

Text Adventure

The C++ programming language is a tool which will serve you well while trying to build video games. It provides low-level access to processors which allows you to write efficient code for a wide variety of computer processors.

This chapter gives a very brief overview of an old-school text adventure written in C++. The code provided is available online at the book’s web page at www.apress.com/9781484208151. The code is intended to be an example of various C++ techniques rather than example of how commercial C++ code should be written.

An Overview of Text Adventure

A very simple text adventure game that you can now expand into a full game if you wish is supplied to accompany this book. Listing 6-1 shows the Game class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required