O'Reilly logo

Developing Games in Java™ by Bret Barker, David Brackeen, Laurence Vanhelsuwé

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 13. Artificial Intelligence

KEY TOPICS

  • AI Basics

  • Take Away Those Godlike Powers!

  • State Machines and Reacting

  • Probability Machines

  • Making Decisions

  • Patterns

  • Object Spawning

  • Putting It All Together

  • Evolution

  • Other Game AI Ideas

  • Summary

One of the first games I ever tried to make was a Pac-Man clone. It had 16 colors, was written in BASIC, ran on a 486, and flickered—a lot.

But the point is, my first attempt at making the ghosts move was a little bit off the mark. Whenever a ghost would have to decide which way to go, it would always move in the direction of the player. This essentially made “super-ghosts” that were so good at tracking Pac-Man down that he rarely had time to eat a power dot. But if he was lucky enough get to a power dot in time, all the ...

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