player moves only when key is pressed, but is buggy