added game logic to collapse plugin