jakobcornell / dubois-traffic-puzzle

traffic puzzle game for Android
0 stars 0 forks source link

Dubois Traffic Puzzle

A traffic puzzle game inspired by Rush Hour, for use by the Dubois Project

Level format

The level format has been slightly adapted from the original format by Camil Staps, et al. In the new format, the colors are defined in application code, and the unnecessary car count line is removed. Like its predecessor, the format uses x- (horizontal, from left) and y- (vertical, from top) coordinates.

The first integer is the left x-coordinate of the goal car (whose y-coordinate is assumed to be 2). All remaining integers are in groups of four, each consisting of two coordinates: the leftmost/top coordinate (x1, y1), and the rightmost/bottom coordinate (x2, y2). A level might look like this:

0
2 1 2 2
3 1 3 3
4 2 4 3

This level has its goal car along the left edge of the board, and three other vehicles, positioned vertically, one of which is a truck. Arbitrary whitespace or a single semicolon may be used to separate each pair of integers. Newlines should be avoided when using the SdbNavigator, as updating any fields in a level record will strip newlines from the map. Under this policy, a good way of writing the above level might be 0;2 1 2 2;3 1 3 3;4 2 4 3.

An issue addressing newline handling has been opened on SdbNavigator's GitHub repository, so keep an eye on that if you're interested in newline support.

Debugging

The app logs stacktraces where I expect interesting errors to occur. If users get messages like "An unexpected error occurred", they should be able to access the corresponding stacktrace by dumping logs through adb:

adb logcat -d -s RushHour

RushHour is the debugging tag, set in the strings.xml resource file.

If something goes wrong while publishing a mathlete's stats to the database, a coach scan activity launches to prompt the user to find a coach. At this point the application should have printed the stats for that play to the log. The coach can run the above command to get the stats and enter them in the database manually.

Issues

Resources

Documentation for Amazon SimpleDB was fairly difficult for me to find (and find again later), so for the benefit of future developers: