To-Till Recall

to-till recall

To-Till Recall┬áis a Windows Phone memory game where you’re based in a supermarket and have to guess all of the items which have gone across the conveyor belt and in to the shopping bag.

Here are some of the items that are within the game:

Hah – I’m feeling hungry already!

This application uses Storyboards to animate the images moving along the conveyor belt and in to the bag. All items subscribe to the same storyboard. When one item has entered the bag, the storyboard resets and targets the next image within the collection.

This is what the collection looks like within the GameManager class:

To shuffle the images, as it would be too easy for the game to have the same set of images to crop-up on every level, I have used a Fisher-Yates algorithm which looks a little like this:

The game consisted of two main classes, the Game.xaml page and the GameManager.cs class which consistently helped the Game build up the game. Within the GameManager class, there are helper methods/properties such as the following:

Something which I had to ensure however is that if the application which you are making for the Windows Phone is a game, you must override the OnBackKeyPress method such that you ask the user if they are sure to exit the game. This prevents the application from navigating to the previous page when the user accidentally clicks on the back button.

The bread and butter of the application is the code below. It fires when the StoryBoard object, called sbMoveImages in this case, completes. When it completes, it focuses on the next image within the collection of images as mentioned earlier.

In terms of main functionality, the above pasted code is the meat of the application. If you have a Windows Phone, why not download the application and let me know what you think? It’s a pretty old app as it was launched back when Windows Phone 7.0 was around but, it’s still as valid as every Chuck Norris joke you come across!