The Little Book of Adventure Game Programming in Java

Chapters

Chapter 1– Communicating with the Game

Chapter 2 ­– The Map

Chapter 3 – Moving the Player

Chapter 4 – Treasures

Chapter 5 – Describing Things

Chapter 6 – Taking and Dropping Things

Chapter 7 – Saving Games

Chapter 8 – Restructuring the Game

Chapter 9 – Object Orientation Revisited

Chapter 10 – Maps, Mazes and Masses

Chapter 11 – Adjectives to Describe Things

Chapter 12 – Creating the Game!

 

The Little Book Of Adventure Game Programming in Java gives you just the stuff you really need to get straight to the heart of text adventure programming without all the fluff and padding.

This book will teach you the secrets of text adventure programming – from beginner to advanced level. You will learn how to create Rooms and Treasures, how to let the player take and drop objects and how to save games using serialization. You will also learn advanced techniques such as using recursion to calculate the combined masses of Treasure objects (so the player can only take a specific number and weight of objects at a time) and parsing adjectives so that the user can enter commands such as “take the small golden Elvish sword”. You can download all the code free – including the Bitwise Interactive Fiction Framework to help you to write your own games!

The Little Book Of Adventure Game Programming in Java provides a step-by-step guide to creating a game in Java. If you want a fun way to extend your knowledge of the Java language and Object Oriented techniques, look no further!

This book explains…

How to write Interactive Fiction (IF) games

  • Creating class hierarchies
  • How to create a map of linked ‘rooms’
  • Moving the player around the map
  • Adding treasures to rooms
  • How to take and drop treasures
  • Putting objects into containers (sacks, treasure chests etc.)
  • Using lists and dictionaries (HashMaps)
  • Overridden methods
  • Overloaded methods
  • How to save and load games
  • Streaming and serialization
  • Recursion
  • Parsing user commands
  • Matching adjectives with objects
  • Distinguishing one object from a similar one (e.g. “small gold ring” or “big silver ring”)
  • Calculating total mass of objects (so player can only carry a specified size or weight)
  • Designing a command-line game to run at the system prompt
  • Write your own games with the free BIFF game framework