public void initWorld(String level) {

		int x = OFFSET;
		int y = OFFSET;

		Tree tree;
		Ship ship;
		Water waterBlock;
		Treasure chest;
		Goal goal;

		// Parse the level string and initialize objects where they need to go.
		for (int pos = 0; pos < level.length(); pos++) {

			char item = level.charAt(pos);

			// New line string, reset x position and move down.
			if (item == '\n') {
				y += SPRITE_WIDTH;
				x = OFFSET;
			}
			// T specifies a tree at this position.
			else if (item == 'T') {
				tree = new Tree(x, y);
				trees.add(tree);
				x += SPRITE_WIDTH;
			}
			// W specifies general water at this position.
			else if (item == 'W') {
				waterBlock = new Water(x, y);
				water.add(waterBlock);
				x += SPRITE_WIDTH;
			}
			// S specifies a ship at this position.
			else if (item == 'S') {
				ship = new Ship(x, y);
				ships.add(ship);
				x += SPRITE_WIDTH;
			}
			// $ specifies treasure at this position.
			else if (item == '$') {
				chest = new Treasure(x, y);
				chests.add(chest);
				x += SPRITE_WIDTH;
			}
			// . specifies a goal spot at this position.
			else if (item == '.') {
				goal = new Goal(x, y);
				goals.add(goal);
				x += SPRITE_WIDTH;
			}
			// @ specifies player starting position.
			else if (item == '@') {
				player = new Player(x, y);
				x += SPRITE_WIDTH;
			}
			// A blank means nothing is here.
			else if (item == ' ') {
				x += SPRITE_WIDTH;
			}
		}

		// Initialize the score for the level
		currentScore = 0;
		// Initialize and start the timer. It will be called every one second.
		timeRemaining = GAME_TIME;
		timer = new Timer(1000, new CDT());
		timer.start();
	}