Book Image

Python Game Programming By Example

Book Image

Python Game Programming By Example

Overview of this book

Table of Contents (14 chapters)
Python Game Programming By Example
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Planning the Checkers application


Let's give further thought to the real-world scene that our Checkers program will expect and the virtual scene it will create. Consider the following close-up photograph, showing part of an 8 x 8 checkerboard. From the top-left corner to right-hand side, we see a light king, a light pawn, a dark pawn, and a dark king.

This checkerboard is just a sheet of matte paper on which black and white squares are printed (the paper is glued to a foam board to make it rigid). The playing pieces happen to be poker chips—red chips for the dark side and gray chips for the light side. A stack of two poker chips is a pawn, while a stack of four is a king. As this example suggests, people may play checkers with homemade or improvised sets. There is no guarantee that two checkers sets will look alike, so we will try to avoid rigid assumptions about the color scheme. However, high contrast is generally helpful in computer vision, and this example is ideal because it uses four...