A TanJTans: Tangrams Meet Java.

A fun Tangram game written in Java.

By: Andrew Jones

Project Supervisor: Sarah Boyd

About:

JTans is a fun graphical game written in Java for the 3rd year Monash Universitiy Comptuer Science individual project subject (CSE3301). JTans provides its player with a graphical representation of the seven shape Chinese puzzle. With JTans the player has the ability to play and manipulate the seven tans (pieces) freely or to attempt to solve the provided puzzles. Hints are also available to help the player. JTans enforces the rules of Tangrams (e.g. no tans can intersect) at all times during play. The player can also use the separate PuzzleBuilder application to create their own Puzzles for use with JTans.

Download:

Compiled Java bytecode (in a jar package) - JTans.tar.gz -- 48KB

Required:

  • Java Virtual Machine version 1.4 or greater.
  • A colour display with a minimum resolution of 600*800 pixels.
To install: Download and unpack the tarball (for windows use WinRAR)

To run: change into the /JTans directory and type - $ java   -jar  JTans.jar

The archive also contains PuzzleBuilder: a stripped down version of JTans, used to output puzzle figures to a file for JTans to use. Look in the JTans/PuzzleBuilder directory.

To run PuzzleBuilder: change into the /JTans/PuzzleBuilder directory and type - $ java   -jar  PuzzleBuilder.jar

Features:

  • Antialiased drawing of colored tans.
  • The tans can be flipped, rotated and moved.
  • Double buffering implemented for smooth polygon movement.
  • Polygon intersection detected when the user drops a tan over another tan. The intersecting tan snaps back to its last safe position.
  • The selected tan changes color.
  • The user can reset the tans to their original positions.
  • The user can deselect all tans.
  • Select from free-play mode or solve-puzzle mode.
  • Multiple default puzzle figures are used.
  • In solve puzzle-mode a silhouette (solution template) of the Tangram figure that the user is going to attempt to solve is displayed in the background.
  • Auto detection of the users solution.
  • An alternative puzzle figures file can be passed to JTans to use as an argument when JTans is run from the command prompt.
  • JTans detects when the user has solved the puzzle via a hard wired solution detection method.
  • A score is calculated via a counting up clock. The lower the score the better.
  • JTans provides and saves the users score when a solution is detected.
  • The user can receive a hint on tan placement within the solution template with a penalty to their score.

PuzzleBuilder Features:

  • Provides the user with larger black tans to build a puzzle with.
  • When a solution has been built by the user the user can, with the mouse, enter vertices for the actual solution template.
  • The user can save their puzzle figure, with a label and difficulty level to a filename they specify.

Screenshot:


Please send comments, bug reports, etc... to Andrew Jones (ajon1@student.monash.edu.au)

JTans' user-tan interaction and layout is loosely based on gtans http://gtans.sourceforge.net/. A rocking Tangram game for Gnome.