Random Spazzes from the player.

Hi! I am writing a program, and my main character is supposed to move in a steady direction. But sometimes he doesn’t move, and sometimes he moves twice. Can someone take a look at the code and tell me if something doesn’t look right? It would help me a lot!
Here is the code for Level.java, should be enough.
http://pastie.org/5840597
If you need anymore info please respond to this thread.

These lines (#91-94, method move) look suspiciously:


} else if (grid[temp.x][temp.y].state == "moveable") {
			Location temp2 = temp.translate(i, j);
			if (grid[temp2.x][temp2.y].state != "moveable"
					&& grid[temp2.x][temp2.y].state != "solid") {

Strings should be tested on equality via 'equals method.

Also, instead of having different states as “String” types objects you could use ints or even better yet, enums!

public enum State { MOVEABLE, SOLID };

If you want to use Strings then, like Stranger said, you can use the String’s equals(Object obj) or equalsIgnoreCase(String anotherString) methods.

Try either of these to see if it fixes the problem.