added ceiling collision check, implemented working gamestates.