public void setDirection(int d) {
		direction = d;
		if (moving) {
			if (!timerStarted) {
				t = new Timer();
				task = new TimerTask() {
					public void run() {
						if (step == 1) {
							step = 2;
						} else
							step = 1;
					}
				};
				t.scheduleAtFixedRate(task, 0, 125);
				task.run();
			}
			timerStarted = true;
		}
	}