Character moves perfectly and recognizes walls. Fixed and improved code at character.c