player positioning logic moved into game loop