CrossShift +

 

click for larger versions.

 

Synopsis:

One of my earliest graphical python games. CrossShift+ is a computer port of a board game I designed, inspired from Reversi/Othello and Go. Featuring a minimalist interface and the earliest iteration of my python engine "silen", the game has a large number of animations and visual effects, and some solid logic optimizations.

 

After the animation engine was written, the game itself was made in a weekend, including all logic. Some fine-tuning was done the following week, including an undo feature (to return to the horizontal shift) and a yellow indicator bar when a move captures enemy pieces.

 

The objective is to have a "cross" (a complete row and a complete column of your pieces) at the start of your turn - this effectively means that your opponent has one turn to break up the cross. You flip pieces by surrounding them orthogonally, much like in Go.

 

Tech:

As the earliest iteration of my silen engine (v0.1), there was a lot of tech designed to simplify the pygame interface towards input handling (including built-in quit and fullscreen toggling), and a very comprehensive animation framework.

 

The animations were defined by mathematical functions, so objects could have smooth starts and smooth ends in addition to linear transitions. At the most basic level, animations are just numbers that change over time, but the framework also included a simplified sprite class for animating frames of a larger spriteset image. My inspiration largely came from the PowerPoint animation framework, and it is nearly a feature-complete copy of it (including smooth start/end, repeat, and reverse (which I called bounce)).

 

The logic for capturing pieces had several optimizations, including only checking the center 6x6 grid for "unsafeness", and starting captured group searches on the two rows/columns adjacent to the shifted one. Groups are only ever captured if the adjacent location in the shifted row changes from black to white, or vice versa, so only these groups were checked. These optimizations allowed for realtime updates on the validity of moves, without any skips in the fluid animation.

 

Gameplay Video:

 

Requirements:

Python 2.5 (cross platform, Mac and Windows)

Pygame 1.8.1 Win Mac (tested on 1.8.0 and 1.8.1)

 

Download Now