O'Reilly logo

The Game Maker’s Apprentice: Game Development for Beginners by Mark Overmars, Jacob Habgood

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. Clever Computers: Playing Tic-Tac-Toe

In this chapter we are going to create a version of the game tic-tac-toe in which you are pitted against an intelligent computer opponent. This opponent must have a strategy that will regularly beat the player to keep it challenging, but the computer opponent must not be too strong; otherwise the player has no chance of winning, and will quickly become frustrated and give up. We will also show how the computer can adapt its play to the level of the player. The game will be almost completely written using the GML programming language, so make sure you read and understood Chapter 12 on GML before starting this chapter.

Designing the Game: Tic-Tac-Toe

I am sure you'll know how to play Tic-Tac-Toe, but ...

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