Added Game replay and Quit buttons to Pygame Dots & Boxes - Issue Number 105 #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This repository contains a Pygame Dots & Boxes game that has been enhanced with replay and quit buttons. These buttons provide users with additional functionality to start a new game or exit the current game. This removes the extra usage of keyboard by players and thus allows to just click on the respective buttons instead of pressing the keys R and Q.
Changes Made : Fixes #105
Replay Button: Added a replay button below the game over message. This button allows users to start a new game after the current game ends. The replay button is displayed with the text "Replay" and has a blue color.
Quit Button: Added a quit button below the replay button. This button allows users to exit the game when clicked. The quit button is displayed with the text "Quit" and has a red color.
Changing Grid size: Changed the grid size to 400X400 i.e SCREEN_WIDTH & SCREEN_HEIGHT to 400 each respectively to ensure proper spacing and padding upon addition of 2 buttons.
Implementation Details
draw_button
function.Testing
Note