O'Reilly logo

Creating Mobile Apps with Sencha Touch 2 by Bryan P. Johnson, John Earl Clark

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

Creating the game controller

The game controller is where the logic for our game will go. Here we will follow the basic rules for checkers:

  • Pieces are initially arranged on the opposite sides of the board in three rows, only on the black squares
  • Pieces can move diagonally
  • Pieces can only move to an empty square
  • Regular pieces can only move forward
  • Pieces can only move one square, unless jumping over an adjacent piece
  • Pieces can only jump one piece at a time
  • Jumped pieces are removed from the board
  • King pieces can move forward and backwards
  • A regular piece that reaches the opposite side of the board is changed to a king piece, ending their current turn
  • The game is finished when all the pieces from one side have been jumped and removed

Our controller will ...

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