make displaybutton() and hidebutton() in ui and refactoring functions in Game