Table of Contents

Java specifications

This page contains part of the Maze assignment specifications, specific to Java.

The game's objective

Your task is to design and implement player, that can find path in the maze from place A to place B. Ideally, the path should be optimal (shortest possible) and the player should find it in shortest possible time.

Player specification

Player is to be implemented in MyPlayer class, in rph.labyrinth.players package. You will have to create this class yourself, you can use already existing player DummyPlayer as source of inspiration. The MyPlayer class should have the following structure:

Game configuration

File named configuration.xml is used to set the maze parameters. Most important are:

windowLeft=“0” windowTop=“0” windowWidth=“800” windowHeight=“600”.

GUI maze functions

GUI maze contains 3 basic components

Algorithm Stepping

To start algorithm stepping, use the Plan Next Step button. First of all you have to implement the stepping into the findPath method of your player. To do this do the following:

  1. At first create Path, where you will save the individual squares.
  2. In each step:
    1. Delete from the map all shown paths: removeAllPaths();
    2. Add current coordinates to Path: path.addCoordinate(coordinate);
    3. Show path (Path) in the maze's window: addPath(path);
    4. Wait for next press of the button: waitForNextStep();