Sunday, October 17, 2010

Amazon Review: Triple Town

Triple Town is the first released game on the Amazon Kindle. I was really excited to try this out, and I'm happy to be one of the first to write a review. Now, I know there are going to be a lot of nay sayers about the obviously lacking computing power of a device like the Kindle, which was designed to be lower power and function to read books, not run games. However, we should all be very familiar with the rules about limits in design: they can push us into greater heights. Is Triple Town the end all of gaming? Of course not. Is it a damn fine game that I'm happy to spend some time with? Absolutely.

Triple Town is what you get if you strip an RTS to its core and make into something of a puzzle game. Danc has a great write up on the design limits that needed to be worked around and where a game like this fits into a map of what works and what simply isn't fun, and finds a snug little place for itself.

Honestly, I'm loving the game. Not just as a neat novelty to have a game on my Kindle, but as a game that I am honestly hooked on as soon as I started playing! The game play is pretty simple and based on a casual match-three, but replacing the usual gems or abstract shapes with units in a town-building game. You plant grass and match them up to make flowers, which you match to make bushes, etc. You can defeat enemies by trapping them, turning them into tombstones, which you can match up to build churches, cathedrals, and more. You have to do a lot of planning to keep room on the board to work with, while also keeping blocked off areas for traps. I like to think I've figured out some strategies that are working pretty well.

I do have my complains. For example, the match-path you need to build a house, in a game about building a town, is grass, flower, bush, tree, logging, and finally the house. It takes more work to build than anything else I've found in the game, and that bothers me just from a perspective of presenting the theme of the game. I think the logging or the flowers could have been cut. I also would have liked to see the highscores online, so I know if I'm doing good or just suck.

Overall, if I was a game reviewer I'd be giving Triple Town a 4/5 and I certainly recommend anyone with a Kindle to grab a copy for only $2.99 at the Amazon store.

Saturday, October 16, 2010

jQuery Plugin: ClipExpand

This is my son standing under the Flying Speghetti Monster. This is a nice photo, but maybe I want to zoom in on just my son. Further, maybe I want to do this on the client-side, not on the server-side.

There are a number of reasons I might want to do this. The most obvious is displaying a thumbnail that expands into the full photo. Rather than load two images, we can load a single one, crop the image to get the thumbnail, and expand it into the full image when the user wants to see it.

We might start by looking into the CSS clip property, but we'd run into an immediate problem: the result is just floating in dead-space! The image will be clipped as we specify, but this only hides the clipped areas and leaves the image otherwise in-place.

A better solution is to take the original layout of the image and reposition and resize it and adjust the clip, so that the region we specify by the clip property is expanded to fit the full size of the space we gave for the image.

This means we can define a simple thumbnail CSS class, and specify a height and width, then by specifying the portion of the image that makes up the thumbnail, they'll be generated and adjusted automatically. This is what the clipexpand() plugin does.

You can see an example usage below. You can grab a copy at the github downloads page for my phototagger app, which this grew out of.

I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.