diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 18c9147181..d28f7f9101 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -1,128 +1,128 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/.github/CONTRIBUTING_GUIDELINE.md b/.github/CONTRIBUTING_GUIDELINE.md index 8e51efb9fc..db19b5a2b2 100644 --- a/.github/CONTRIBUTING_GUIDELINE.md +++ b/.github/CONTRIBUTING_GUIDELINE.md @@ -1,67 +1,67 @@ -# **Contributing Guidelines** ๐Ÿ“„ - -This documentation contains a set of guidelines to help you during the contribution process. -We are happy to welcome all the contributions from anyone willing to improve/add new scripts to this project. -Thank you for helping out and remember, **no contribution is too small.** -
-Please note we have a [code of conduct](CODE_OF_CONDUCT.md) please follow it in all your interactions with the project. - - - -
- -## **Need some help regarding the basics?๐Ÿค”** - - -You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, -in case you are stuck: - -- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) -- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-an-issue-or-pull-request) -- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github) -- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6) -- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github) - -
- -## **Issue Report Process ๐Ÿ“Œ** - -1. Go to the project's issues. -2. Select the template that better fits your issue. -3. Give proper description for the issues. -4. Don't spam to get the assignment of the issue ๐Ÿ˜€. -5. Wait for till someone is looking into it !. -6. Start working on issue only after you got assigned that issue ๐Ÿš€. - -
- -## **File naming conventions ๐Ÿ“** -- Give unique name for your game that is not already existed -* Folder naming convention - - ```Game_Name``` ex. ```Tilting_Maze``` (first letter should be capital and if you need space use _ ) -* files in the folder - - ```index.html``` , ```script.js``` , ```style.css```(not stictly to follow this but you should have separate ) - - you can have other folders if you are having assets for your game - - ```README.md``` for your folder using template [TEMPLATE](../Games/FOLDER_README_TEMPLATE.md) - - It is not compulsory to follow this README template only you can have your own -* naming convention for the screenshot you will add in ```assets/images``` - - name of image should be same as your game name - - ex. ```Tilting_Maze.jpeg``` or .jpg or .png any of the image formate - -
- -## **Pull Request Process ๐Ÿš€** - -1. Ensure that you have self reviewed your code ๐Ÿ˜€ -2. Make sure you have added the proper description for the functionality of the code -3. You have added README file in your repository . -4. You have added the thumbnail of the project into ```assets/images``` for website preview -5. Add your game screenshot in the assets folder by following the proper conversion specified over here -6. You have added your game name and link in main README.md -7. Submit your PR by giving the necesarry information in PR template and hang tight we will review it really soon ๐Ÿš€ - -
- -# **Happy Hacking ๐Ÿ’—** - - +# **Contributing Guidelines** ๐Ÿ“„ + +This documentation contains a set of guidelines to help you during the contribution process. +We are happy to welcome all the contributions from anyone willing to improve/add new scripts to this project. +Thank you for helping out and remember, **no contribution is too small.** +
+Please note we have a [code of conduct](CODE_OF_CONDUCT.md) please follow it in all your interactions with the project. + + + +
+ +## **Need some help regarding the basics?๐Ÿค”** + + +You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, +in case you are stuck: + +- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) +- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-an-issue-or-pull-request) +- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github) +- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6) +- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github) + +
+ +## **Issue Report Process ๐Ÿ“Œ** + +1. Go to the project's issues. +2. Select the template that better fits your issue. +3. Give proper description for the issues. +4. Don't spam to get the assignment of the issue ๐Ÿ˜€. +5. Wait for till someone is looking into it !. +6. Start working on issue only after you got assigned that issue ๐Ÿš€. + +
+ +## **File naming conventions ๐Ÿ“** +- Give unique name for your game that is not already existed +* Folder naming convention + - ```Game_Name``` ex. ```Tilting_Maze``` (first letter should be capital and if you need space use _ ) +* files in the folder + - ```index.html``` , ```script.js``` , ```style.css```(not stictly to follow this but you should have separate ) + - you can have other folders if you are having assets for your game + - ```README.md``` for your folder using template [TEMPLATE](../Games/FOLDER_README_TEMPLATE.md) + - It is not compulsory to follow this README template only you can have your own +* naming convention for the screenshot you will add in ```assets/images``` + - name of image should be same as your game name + - ex. ```Tilting_Maze.jpeg``` or .jpg or .png any of the image formate + +
+ +## **Pull Request Process ๐Ÿš€** + +1. Ensure that you have self reviewed your code ๐Ÿ˜€ +2. Make sure you have added the proper description for the functionality of the code +3. You have added README file in your repository . +4. You have added the thumbnail of the project into ```assets/images``` for website preview +5. Add your game screenshot in the assets folder by following the proper conversion specified over here +6. You have added your game name and link in main README.md +7. Submit your PR by giving the necesarry information in PR template and hang tight we will review it really soon ๐Ÿš€ + +
+ +# **Happy Hacking ๐Ÿ’—** + + diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 172696bda1..aac48b09a1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,52 +1,52 @@ -name: Bug Report ๐Ÿชฒ -description: Report your bug by filling teh information given below -title: "[Bug]: " - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - type: textarea - id: bug-description - attributes: - label: Give a brief about the bug โœ๏ธ - description: Enter a brief description about the bug report - placeholder: Please include a summary, also include relevant motivation and context. - value: "Description" - validations: - required: true - - type: textarea - id: behaviors - attributes: - label: What is the expected behavior? ๐Ÿค” - description: Enter the expected behavior of bug - placeholder: Please include a summary, also include relevant motivation and context. - value: "Description" - validations: - required: true - - type: textarea - id: instructions - attributes: - label: Provide step by step information reproduce the bug ๐Ÿ“„ - description: Enter the description on how you plan to find the bug's solution - placeholder: Please include a summary, also include relevant motivation and context. - value: "Description" - validations: - required: true - - type: dropdown - id: contribution - attributes: - label: Select program in which you are contributing - multiple: true - options: - - GSSoC23 - - Other - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) - options: - - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. +name: Bug Report ๐Ÿชฒ +description: Report your bug by filling teh information given below +title: "[Bug]: " + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: bug-description + attributes: + label: Give a brief about the bug โœ๏ธ + description: Enter a brief description about the bug report + placeholder: Please include a summary, also include relevant motivation and context. + value: "Description" + validations: + required: true + - type: textarea + id: behaviors + attributes: + label: What is the expected behavior? ๐Ÿค” + description: Enter the expected behavior of bug + placeholder: Please include a summary, also include relevant motivation and context. + value: "Description" + validations: + required: true + - type: textarea + id: instructions + attributes: + label: Provide step by step information reproduce the bug ๐Ÿ“„ + description: Enter the description on how you plan to find the bug's solution + placeholder: Please include a summary, also include relevant motivation and context. + value: "Description" + validations: + required: true + - type: dropdown + id: contribution + attributes: + label: Select program in which you are contributing + multiple: true + options: + - GSSoC23 + - Other + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation_bug.yml b/.github/ISSUE_TEMPLATE/documentation_bug.yml index caec8461eb..4f5d120e44 100644 --- a/.github/ISSUE_TEMPLATE/documentation_bug.yml +++ b/.github/ISSUE_TEMPLATE/documentation_bug.yml @@ -1,43 +1,43 @@ -name: ๐Ÿ“š Documentation or README.md issue report -description: Report an issue in the project's documentation or README.md file. -title: "[Documentation Bug]: " - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this documentation bug report! - - type: textarea - id: documentation-bug-description - attributes: - label: Describe the bug โœ๏ธ - description: Enter a brief description about the documentation bug report - placeholder: Please include a summary, also include relevant motivation and context. - value: "Describe your bug here" - validations: - required: true - - type: textarea - id: instructions - attributes: - label: Provide step by step information reproduce the bug ๐Ÿ“„ - description: Enter the description on how you plan to find the bug's solution - placeholder: Please include a summary, also include relevant motivation and context. - value: "Description" - validations: - required: true - - type: dropdown - id: contribution - attributes: - label: Select program in which you are contributing - multiple: true - options: - - GSSoC23 - - Other - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) - options: - - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. +name: ๐Ÿ“š Documentation or README.md issue report +description: Report an issue in the project's documentation or README.md file. +title: "[Documentation Bug]: " + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this documentation bug report! + - type: textarea + id: documentation-bug-description + attributes: + label: Describe the bug โœ๏ธ + description: Enter a brief description about the documentation bug report + placeholder: Please include a summary, also include relevant motivation and context. + value: "Describe your bug here" + validations: + required: true + - type: textarea + id: instructions + attributes: + label: Provide step by step information reproduce the bug ๐Ÿ“„ + description: Enter the description on how you plan to find the bug's solution + placeholder: Please include a summary, also include relevant motivation and context. + value: "Description" + validations: + required: true + - type: dropdown + id: contribution + attributes: + label: Select program in which you are contributing + multiple: true + options: + - GSSoC23 + - Other + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/game_enhancement.yml b/.github/ISSUE_TEMPLATE/game_enhancement.yml index 494a3dba17..15252cb699 100644 --- a/.github/ISSUE_TEMPLATE/game_enhancement.yml +++ b/.github/ISSUE_TEMPLATE/game_enhancement.yml @@ -1,43 +1,43 @@ -name: ๐Ÿš€โž•Game Enhancement Request -description: Suggest your enhancement for the existing game -title: "[Enhancement]: " - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this enhancement request form - - type: textarea - id: bug-description - attributes: - label: Is your enhancement request related to a problem? Please describe.โž• - description: Enter a brief description about the enhancement you need - placeholder: Give all the context of your enhancement as well as the existing game - value: "Game enhancement" - validations: - required: true - - type: textarea - id: behaviour - attributes: - label: Describe the solution you'd like - description: Give steps in which you will solve it - placeholder: Please include a summary, also include relevant motivation and context. - value: "Solution steps" - validations: - required: true - - type: dropdown - id: contribution - attributes: - label: Select program in which you are contributing - multiple: true - options: - - GSSoC23 - - Other - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) - options: - - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. +name: ๐Ÿš€โž•Game Enhancement Request +description: Suggest your enhancement for the existing game +title: "[Enhancement]: " + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this enhancement request form + - type: textarea + id: bug-description + attributes: + label: Is your enhancement request related to a problem? Please describe.โž• + description: Enter a brief description about the enhancement you need + placeholder: Give all the context of your enhancement as well as the existing game + value: "Game enhancement" + validations: + required: true + - type: textarea + id: behaviour + attributes: + label: Describe the solution you'd like + description: Give steps in which you will solve it + placeholder: Please include a summary, also include relevant motivation and context. + value: "Solution steps" + validations: + required: true + - type: dropdown + id: contribution + attributes: + label: Select program in which you are contributing + multiple: true + options: + - GSSoC23 + - Other + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/new_game_request.yml b/.github/ISSUE_TEMPLATE/new_game_request.yml index 0c23f42ff9..d5e2e54f66 100644 --- a/.github/ISSUE_TEMPLATE/new_game_request.yml +++ b/.github/ISSUE_TEMPLATE/new_game_request.yml @@ -1,43 +1,43 @@ -name: ๐Ÿ†•๐ŸŽฎ new game request -description: Suggest an idea and show your creativity to add new game -title: "[New game]: " - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out your new game issue - - type: textarea - id: new-game - attributes: - label: ๐ŸŽฎ Game Request - description: Describe the game logic and also give a brief about the features of the game - placeholder: add all necessary details required for your new game - value: "Game logic and basic description" - validations: - required: true - - type: textarea - id: features - attributes: - label: Point down the features - description: think about your the feature your game will have - placeholder: Please include a summary, also include relevant motivation and context. - value: "Game points" - validations: - required: true - - type: dropdown - id: contribution - attributes: - label: Select program in which you are contributing - multiple: true - options: - - GSSoC23 - - Other - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) - options: - - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. +name: ๐Ÿ†•๐ŸŽฎ new game request +description: Suggest an idea and show your creativity to add new game +title: "[New game]: " + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out your new game issue + - type: textarea + id: new-game + attributes: + label: ๐ŸŽฎ Game Request + description: Describe the game logic and also give a brief about the features of the game + placeholder: add all necessary details required for your new game + value: "Game logic and basic description" + validations: + required: true + - type: textarea + id: features + attributes: + label: Point down the features + description: think about your the feature your game will have + placeholder: Please include a summary, also include relevant motivation and context. + value: "Game points" + validations: + required: true + - type: dropdown + id: contribution + attributes: + label: Select program in which you are contributing + multiple: true + options: + - GSSoC23 + - Other + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question_and_support.yml b/.github/ISSUE_TEMPLATE/question_and_support.yml index 356f93b756..dc77418160 100644 --- a/.github/ISSUE_TEMPLATE/question_and_support.yml +++ b/.github/ISSUE_TEMPLATE/question_and_support.yml @@ -1,34 +1,34 @@ -name: โ“ Question or Support Request -description: Questions and requests for support. -title: "[Question]: " - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this and letting us know your question - - type: textarea - id: description - attributes: - label: Describe your question or ask for support.โ“ - description: Enter a brief description about your question or support needed - placeholder: Please include a summary, also include relevant motivation and context. - value: "Description" - validations: - required: true - - type: dropdown - id: contribution - attributes: - label: Select program in which you are contributing - multiple: true - options: - - GSSoC23 - - Other - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) - options: - - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. +name: โ“ Question or Support Request +description: Questions and requests for support. +title: "[Question]: " + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this and letting us know your question + - type: textarea + id: description + attributes: + label: Describe your question or ask for support.โ“ + description: Enter a brief description about your question or support needed + placeholder: Please include a summary, also include relevant motivation and context. + value: "Description" + validations: + required: true + - type: dropdown + id: contribution + attributes: + label: Select program in which you are contributing + multiple: true + options: + - GSSoC23 + - Other + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) of this project. required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f475dbdf9b..3c364b3fb2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,34 +1,34 @@ -## PR Description ๐Ÿ“œ - -Please include summary related to the issue you have fixed and describe your PR in brief over here by specifying the issue number on which you were working below -Fixes # - -
- -## Mark the task you have completed โœ… - - - -- [ ] I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) & [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) of this project. -- [ ] I have performed a self-review of my own code or work. -- [ ] I have commented my code, particularly in hard-to-understand areas. -- [ ] My changes generates no new warnings. -- [ ] I have followed proper naming convention showed in [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) -- [ ] I have added screenshot for website preview in assets/images -- [ ] I have added entries for my game in main README.md -- [ ] I have added README.md in my folder -- [ ] I have added working video of the game in README.md (optional) -- [ ] I have specified the respective issue number for which I have requested the new game. - - -
- -## Add your screenshots(Optional) ๐Ÿ“ธ - - - - ---- -
- +## PR Description ๐Ÿ“œ + +Please include summary related to the issue you have fixed and describe your PR in brief over here by specifying the issue number on which you were working below +Fixes # + +
+ +## Mark the task you have completed โœ… + + + +- [ ] I follow [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) & [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) of this project. +- [ ] I have performed a self-review of my own code or work. +- [ ] I have commented my code, particularly in hard-to-understand areas. +- [ ] My changes generates no new warnings. +- [ ] I have followed proper naming convention showed in [CONTRIBUTING GUIDELINE](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) +- [ ] I have added screenshot for website preview in assets/images +- [ ] I have added entries for my game in main README.md +- [ ] I have added README.md in my folder +- [ ] I have added working video of the game in README.md (optional) +- [ ] I have specified the respective issue number for which I have requested the new game. + + +
+ +## Add your screenshots(Optional) ๐Ÿ“ธ + + + + +--- +
+ ## Thank you soo much for contributing to our repository ๐Ÿ’— \ No newline at end of file diff --git a/.github/node_modules/.package-lock.json b/.github/node_modules/.package-lock.json index b315f0068d..0a7e6879fd 100644 --- a/.github/node_modules/.package-lock.json +++ b/.github/node_modules/.package-lock.json @@ -1,13 +1,13 @@ -{ - "name": "test", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/string-similarity": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz", - "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info." - } - } -} +{ + "name": "test", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/string-similarity": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz", + "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info." + } + } +} diff --git a/.github/old_workflows/assign.yml b/.github/old_workflows/assign.yml index 7929a324f4..e5e3ad05cd 100644 --- a/.github/old_workflows/assign.yml +++ b/.github/old_workflows/assign.yml @@ -1,72 +1,72 @@ -name: Assign on Comment -on: - issue_comment: - types: - - created - -jobs: - assign: - runs-on: ubuntu-latest - - steps: - - name: Check if /assign command is present - id: check_command - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const commentBody = context.payload.comment.body; - const assignCommand = '/assign'; - const isCommandPresent = commentBody.includes(assignCommand); - console.log(`Command present: ${isCommandPresent}`); - console.log(`Comment: ${commentBody}`); - console.log(`Issue Number: ${context.payload.issue.number}`); - console.log(`Issue State: ${context.payload.issue.state}`); - console.log(`Assignees: ${context.payload.issue.assignees.map(assignee => assignee.login)}`); - console.log(`Issue URL: ${context.payload.issue.html_url}`); - console.log(`Comment URL: ${context.payload.comment.html_url}`); - console.log(`Comment Author: ${context.payload.comment.user.login}`); - console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`); - console.log(`Repository URL: ${context.payload.repository.html_url}`); - console.log(`Repository Full Name: ${context.payload.repository.full_name}`); - console.log(`Repository Name: ${context.payload.repository.name}`); - console.log(`Repository Owner: ${context.payload.repository.owner.login}`); - console.log(`Repository Owner URL: ${context.payload.repository.owner.html_url}`); - console.log(`Event Name: ${context.eventName}`); - - const commentAuthor = context.payload.comment.user.login; - core.setOutput('comment_author', commentAuthor); - - const isGreetingFromOwner = commentAuthor === context.payload.repository.owner.login; - core.setOutput('is_greeting_from_owner', isGreetingFromOwner.toString()); - - const isAlreadyAssigned = context.payload.issue.assignees.length > 0; - core.setOutput('is_already_assigned', isAlreadyAssigned.toString()); - - if (isCommandPresent && isGreetingFromOwner) { - console.log('Skipping assigning issue: Greeting from repository owner.'); - console.log(`::set-output name=assign_issue::false`); - } else if (isCommandPresent && isAlreadyAssigned) { - const { owner, repo, number } = context.issue; - const assignees = context.payload.issue.assignees.map(assignee => assignee.login).join(', '); - const commentBody = `Hey @${commentAuthor} ! , This issue is already assigned to @${assignees}. ๐Ÿ’— \n You can work on other issues ๐Ÿš€ \n If there is anything wrong you can contact us on [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG)๐Ÿ‘€`; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the issue: ${commentBody}.`); - console.log(`::set-output name=assign_issue::false`); - } else if (isCommandPresent) { - console.log(`::set-output name=assign_issue::true`); - } else { - console.log(`::set-output name=assign_issue::false`); - } - - - name: Assign the issue - if: steps.check_command.outputs.assign_issue == 'true' - id: assign_issue - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const assignee = context.payload.comment.user.login; - await github.issues.addAssignees({ owner, repo, issue_number: number, assignees: [assignee] }); - console.log(`Assigned the issue to ${assignee}.`); +name: Assign on Comment +on: + issue_comment: + types: + - created + +jobs: + assign: + runs-on: ubuntu-latest + + steps: + - name: Check if /assign command is present + id: check_command + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const commentBody = context.payload.comment.body; + const assignCommand = '/assign'; + const isCommandPresent = commentBody.includes(assignCommand); + console.log(`Command present: ${isCommandPresent}`); + console.log(`Comment: ${commentBody}`); + console.log(`Issue Number: ${context.payload.issue.number}`); + console.log(`Issue State: ${context.payload.issue.state}`); + console.log(`Assignees: ${context.payload.issue.assignees.map(assignee => assignee.login)}`); + console.log(`Issue URL: ${context.payload.issue.html_url}`); + console.log(`Comment URL: ${context.payload.comment.html_url}`); + console.log(`Comment Author: ${context.payload.comment.user.login}`); + console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`); + console.log(`Repository URL: ${context.payload.repository.html_url}`); + console.log(`Repository Full Name: ${context.payload.repository.full_name}`); + console.log(`Repository Name: ${context.payload.repository.name}`); + console.log(`Repository Owner: ${context.payload.repository.owner.login}`); + console.log(`Repository Owner URL: ${context.payload.repository.owner.html_url}`); + console.log(`Event Name: ${context.eventName}`); + + const commentAuthor = context.payload.comment.user.login; + core.setOutput('comment_author', commentAuthor); + + const isGreetingFromOwner = commentAuthor === context.payload.repository.owner.login; + core.setOutput('is_greeting_from_owner', isGreetingFromOwner.toString()); + + const isAlreadyAssigned = context.payload.issue.assignees.length > 0; + core.setOutput('is_already_assigned', isAlreadyAssigned.toString()); + + if (isCommandPresent && isGreetingFromOwner) { + console.log('Skipping assigning issue: Greeting from repository owner.'); + console.log(`::set-output name=assign_issue::false`); + } else if (isCommandPresent && isAlreadyAssigned) { + const { owner, repo, number } = context.issue; + const assignees = context.payload.issue.assignees.map(assignee => assignee.login).join(', '); + const commentBody = `Hey @${commentAuthor} ! , This issue is already assigned to @${assignees}. ๐Ÿ’— \n You can work on other issues ๐Ÿš€ \n If there is anything wrong you can contact us on [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG)๐Ÿ‘€`; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the issue: ${commentBody}.`); + console.log(`::set-output name=assign_issue::false`); + } else if (isCommandPresent) { + console.log(`::set-output name=assign_issue::true`); + } else { + console.log(`::set-output name=assign_issue::false`); + } + + - name: Assign the issue + if: steps.check_command.outputs.assign_issue == 'true' + id: assign_issue + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const assignee = context.payload.comment.user.login; + await github.issues.addAssignees({ owner, repo, issue_number: number, assignees: [assignee] }); + console.log(`Assigned the issue to ${assignee}.`); diff --git a/.github/old_workflows/greet.yml b/.github/old_workflows/greet.yml index fe570e59b0..a1ef092ce7 100644 --- a/.github/old_workflows/greet.yml +++ b/.github/old_workflows/greet.yml @@ -1,53 +1,53 @@ -name: Comment and Label on Issue Opened -on: - issues: - types: - - opened - -jobs: - comment_and_label: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Add comment - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const commentAuthor = context.payload.issue.user.login; - const commentBody = `Hey @${commentAuthor} ! \n Thank you for raising an issue ๐Ÿ’— \n You can self assign the issue by commenting /assign in comment ๐Ÿ˜€ \n Make sure you follow [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) and [CONTRIBUTING GUIDELINES](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) ๐Ÿš€ \n Donโ€™t Forget to โญ our [GameZone๐ŸŽฎ](https://github.com/kunjgit/GameZone)\n Make sure you join our [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) `; - const { owner, repo, number } = context.issue; - - await github.issues.createComment({ - owner: owner, - repo: repo, - issue_number: number, - body: commentBody - }); - - - name: Add label if issue body contains "GSSoC23" - id: check_label - run: | - if [[ $(echo "${{ github.event.issue.body }}" | grep -q "GSSoC23"; echo $?) == 0 ]]; then - echo "::set-output name=add_label::true" - else - echo "::set-output name=add_label::false" - fi - - - name: Add label "GSSoC23" - if: ${{ steps.check_label.outputs.add_label == 'true' }} - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - - await github.issues.addLabels({ - owner: owner, - repo: repo, - issue_number: number, - labels: ["GSSoC23"] - }); +name: Comment and Label on Issue Opened +on: + issues: + types: + - opened + +jobs: + comment_and_label: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Add comment + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const commentAuthor = context.payload.issue.user.login; + const commentBody = `Hey @${commentAuthor} ! \n Thank you for raising an issue ๐Ÿ’— \n You can self assign the issue by commenting /assign in comment ๐Ÿ˜€ \n Make sure you follow [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) and [CONTRIBUTING GUIDELINES](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) ๐Ÿš€ \n Donโ€™t Forget to โญ our [GameZone๐ŸŽฎ](https://github.com/kunjgit/GameZone)\n Make sure you join our [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) `; + const { owner, repo, number } = context.issue; + + await github.issues.createComment({ + owner: owner, + repo: repo, + issue_number: number, + body: commentBody + }); + + - name: Add label if issue body contains "GSSoC23" + id: check_label + run: | + if [[ $(echo "${{ github.event.issue.body }}" | grep -q "GSSoC23"; echo $?) == 0 ]]; then + echo "::set-output name=add_label::true" + else + echo "::set-output name=add_label::false" + fi + + - name: Add label "GSSoC23" + if: ${{ steps.check_label.outputs.add_label == 'true' }} + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + + await github.issues.addLabels({ + owner: owner, + repo: repo, + issue_number: number, + labels: ["GSSoC23"] + }); diff --git a/.github/old_workflows/issue_close_greet.yml b/.github/old_workflows/issue_close_greet.yml index 8e091174ac..9489218ef4 100644 --- a/.github/old_workflows/issue_close_greet.yml +++ b/.github/old_workflows/issue_close_greet.yml @@ -1,22 +1,22 @@ -name: Comment on Issue Closure -on: - issues: - types: - - closed - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on Issue Closure - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const author = context.payload.issue.user.login; - const commentBody = `Hey @${author} ! Thank you so much for your raising the issue๐Ÿ’— \n Itโ€™s all yours, you can come anytime again and make some contributions! ๐Ÿš€ \n Alone, we can do little, but together we can do so much! ๐Ÿ˜‡ - `; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the issue: ${commentBody}.`); +name: Comment on Issue Closure +on: + issues: + types: + - closed + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Comment on Issue Closure + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const author = context.payload.issue.user.login; + const commentBody = `Hey @${author} ! Thank you so much for your raising the issue๐Ÿ’— \n Itโ€™s all yours, you can come anytime again and make some contributions! ๐Ÿš€ \n Alone, we can do little, but together we can do so much! ๐Ÿ˜‡ + `; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the issue: ${commentBody}.`); diff --git a/.github/old_workflows/pr_close_greet.yml b/.github/old_workflows/pr_close_greet.yml index 5e0c5347c9..814e727cf7 100644 --- a/.github/old_workflows/pr_close_greet.yml +++ b/.github/old_workflows/pr_close_greet.yml @@ -1,22 +1,22 @@ -name: Comment on PR Closure -on: - pull_request_target: - types: - - closed - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on PR Closure - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const commentAuthor = context.payload.pull_request.user.login; - const commentBody = `Thank you @${commentAuthor} , for your valuable time and contribution in our GameZone ๐Ÿ’—. \n Itโ€™s our GameZone, so Letโ€™s build this GameZone altogether !!๐Ÿค\n Hoping to see you soon with another PR again ๐Ÿ˜‡ \n Wishing you all the best for your journey into Open Source๐Ÿš€ - `; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the closed PR: ${commentBody}.`); +name: Comment on PR Closure +on: + pull_request_target: + types: + - closed + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Comment on PR Closure + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const commentAuthor = context.payload.pull_request.user.login; + const commentBody = `Thank you @${commentAuthor} , for your valuable time and contribution in our GameZone ๐Ÿ’—. \n Itโ€™s our GameZone, so Letโ€™s build this GameZone altogether !!๐Ÿค\n Hoping to see you soon with another PR again ๐Ÿ˜‡ \n Wishing you all the best for your journey into Open Source๐Ÿš€ + `; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the closed PR: ${commentBody}.`); diff --git a/.github/old_workflows/pr_greet.yml b/.github/old_workflows/pr_greet.yml index 4ebc068efa..eda9dc1a9d 100644 --- a/.github/old_workflows/pr_greet.yml +++ b/.github/old_workflows/pr_greet.yml @@ -1,22 +1,22 @@ -name: Comment on PR Creation -on: - pull_request_target: - types: - - opened - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on PR - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const commentAuthor = context.payload.sender.login; - const commentBody = `Thank you @${commentAuthor} ,for creating the PR and contributing to our GameZone ๐Ÿ’— \n Review team will review the PR and will reach out to you soon! ๐Ÿ˜‡ \n Make sure that you have marked all the tasks that you are done with โœ…. \n Thank you for your patience! ๐Ÿ˜€ - `; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the PR: ${commentBody}.`); +name: Comment on PR Creation +on: + pull_request_target: + types: + - opened + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Comment on PR + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const commentAuthor = context.payload.sender.login; + const commentBody = `Thank you @${commentAuthor} ,for creating the PR and contributing to our GameZone ๐Ÿ’— \n Review team will review the PR and will reach out to you soon! ๐Ÿ˜‡ \n Make sure that you have marked all the tasks that you are done with โœ…. \n Thank you for your patience! ๐Ÿ˜€ + `; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the PR: ${commentBody}.`); diff --git a/.github/workflows/annoucement.yml b/.github/workflows/annoucement.yml index b47d5398b2..02f91c7723 100644 --- a/.github/workflows/annoucement.yml +++ b/.github/workflows/annoucement.yml @@ -1,45 +1,45 @@ -name: Issue Announcement -on: - workflow_dispatch: - -jobs: - issue-announcement: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Comment on opened issues - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const commentBody = `\n @${context.payload.sender.login} here, \n We have this annoucement to make ๐Ÿ“ข!! \n During the time of PR don't alter main index file ! ๐Ÿ™‚ \n In main Readme file just use * as a game number during the time we are merging we will add number !! ๐Ÿ‘€ \n Make sure you join our [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) if you haven't ๐Ÿ˜‡ \n Thank you ๐Ÿ’—!`; - - // Get the list of opened issues - const { data: issues } = await github.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - per_page: 100 // Adjust the per_page value as per your requirements - }); - - // Comment on each opened issue - for (const issue of issues) { - const opener = issue.user.login; - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue.number, - body: `Hey @${opener} ๐Ÿ‘‹!\n ${commentBody}\n\n` - }); - - console.log(`Commented on issue #${issue.number}.`); - } - +name: Issue Announcement +on: + workflow_dispatch: + +jobs: + issue-announcement: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Comment on opened issues + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const commentBody = `\n @${context.payload.sender.login} here, \n We have this annoucement to make ๐Ÿ“ข!! \n During the time of PR don't alter main index file ! ๐Ÿ™‚ \n In main Readme file just use * as a game number during the time we are merging we will add number !! ๐Ÿ‘€ \n Make sure you join our [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) if you haven't ๐Ÿ˜‡ \n Thank you ๐Ÿ’—!`; + + // Get the list of opened issues + const { data: issues } = await github.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + per_page: 100 // Adjust the per_page value as per your requirements + }); + + // Comment on each opened issue + for (const issue of issues) { + const opener = issue.user.login; + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + body: `Hey @${opener} ๐Ÿ‘‹!\n ${commentBody}\n\n` + }); + + console.log(`Commented on issue #${issue.number}.`); + } + diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml index 7929a324f4..e5e3ad05cd 100644 --- a/.github/workflows/assign.yml +++ b/.github/workflows/assign.yml @@ -1,72 +1,72 @@ -name: Assign on Comment -on: - issue_comment: - types: - - created - -jobs: - assign: - runs-on: ubuntu-latest - - steps: - - name: Check if /assign command is present - id: check_command - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const commentBody = context.payload.comment.body; - const assignCommand = '/assign'; - const isCommandPresent = commentBody.includes(assignCommand); - console.log(`Command present: ${isCommandPresent}`); - console.log(`Comment: ${commentBody}`); - console.log(`Issue Number: ${context.payload.issue.number}`); - console.log(`Issue State: ${context.payload.issue.state}`); - console.log(`Assignees: ${context.payload.issue.assignees.map(assignee => assignee.login)}`); - console.log(`Issue URL: ${context.payload.issue.html_url}`); - console.log(`Comment URL: ${context.payload.comment.html_url}`); - console.log(`Comment Author: ${context.payload.comment.user.login}`); - console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`); - console.log(`Repository URL: ${context.payload.repository.html_url}`); - console.log(`Repository Full Name: ${context.payload.repository.full_name}`); - console.log(`Repository Name: ${context.payload.repository.name}`); - console.log(`Repository Owner: ${context.payload.repository.owner.login}`); - console.log(`Repository Owner URL: ${context.payload.repository.owner.html_url}`); - console.log(`Event Name: ${context.eventName}`); - - const commentAuthor = context.payload.comment.user.login; - core.setOutput('comment_author', commentAuthor); - - const isGreetingFromOwner = commentAuthor === context.payload.repository.owner.login; - core.setOutput('is_greeting_from_owner', isGreetingFromOwner.toString()); - - const isAlreadyAssigned = context.payload.issue.assignees.length > 0; - core.setOutput('is_already_assigned', isAlreadyAssigned.toString()); - - if (isCommandPresent && isGreetingFromOwner) { - console.log('Skipping assigning issue: Greeting from repository owner.'); - console.log(`::set-output name=assign_issue::false`); - } else if (isCommandPresent && isAlreadyAssigned) { - const { owner, repo, number } = context.issue; - const assignees = context.payload.issue.assignees.map(assignee => assignee.login).join(', '); - const commentBody = `Hey @${commentAuthor} ! , This issue is already assigned to @${assignees}. ๐Ÿ’— \n You can work on other issues ๐Ÿš€ \n If there is anything wrong you can contact us on [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG)๐Ÿ‘€`; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the issue: ${commentBody}.`); - console.log(`::set-output name=assign_issue::false`); - } else if (isCommandPresent) { - console.log(`::set-output name=assign_issue::true`); - } else { - console.log(`::set-output name=assign_issue::false`); - } - - - name: Assign the issue - if: steps.check_command.outputs.assign_issue == 'true' - id: assign_issue - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const assignee = context.payload.comment.user.login; - await github.issues.addAssignees({ owner, repo, issue_number: number, assignees: [assignee] }); - console.log(`Assigned the issue to ${assignee}.`); +name: Assign on Comment +on: + issue_comment: + types: + - created + +jobs: + assign: + runs-on: ubuntu-latest + + steps: + - name: Check if /assign command is present + id: check_command + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const commentBody = context.payload.comment.body; + const assignCommand = '/assign'; + const isCommandPresent = commentBody.includes(assignCommand); + console.log(`Command present: ${isCommandPresent}`); + console.log(`Comment: ${commentBody}`); + console.log(`Issue Number: ${context.payload.issue.number}`); + console.log(`Issue State: ${context.payload.issue.state}`); + console.log(`Assignees: ${context.payload.issue.assignees.map(assignee => assignee.login)}`); + console.log(`Issue URL: ${context.payload.issue.html_url}`); + console.log(`Comment URL: ${context.payload.comment.html_url}`); + console.log(`Comment Author: ${context.payload.comment.user.login}`); + console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`); + console.log(`Repository URL: ${context.payload.repository.html_url}`); + console.log(`Repository Full Name: ${context.payload.repository.full_name}`); + console.log(`Repository Name: ${context.payload.repository.name}`); + console.log(`Repository Owner: ${context.payload.repository.owner.login}`); + console.log(`Repository Owner URL: ${context.payload.repository.owner.html_url}`); + console.log(`Event Name: ${context.eventName}`); + + const commentAuthor = context.payload.comment.user.login; + core.setOutput('comment_author', commentAuthor); + + const isGreetingFromOwner = commentAuthor === context.payload.repository.owner.login; + core.setOutput('is_greeting_from_owner', isGreetingFromOwner.toString()); + + const isAlreadyAssigned = context.payload.issue.assignees.length > 0; + core.setOutput('is_already_assigned', isAlreadyAssigned.toString()); + + if (isCommandPresent && isGreetingFromOwner) { + console.log('Skipping assigning issue: Greeting from repository owner.'); + console.log(`::set-output name=assign_issue::false`); + } else if (isCommandPresent && isAlreadyAssigned) { + const { owner, repo, number } = context.issue; + const assignees = context.payload.issue.assignees.map(assignee => assignee.login).join(', '); + const commentBody = `Hey @${commentAuthor} ! , This issue is already assigned to @${assignees}. ๐Ÿ’— \n You can work on other issues ๐Ÿš€ \n If there is anything wrong you can contact us on [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG)๐Ÿ‘€`; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the issue: ${commentBody}.`); + console.log(`::set-output name=assign_issue::false`); + } else if (isCommandPresent) { + console.log(`::set-output name=assign_issue::true`); + } else { + console.log(`::set-output name=assign_issue::false`); + } + + - name: Assign the issue + if: steps.check_command.outputs.assign_issue == 'true' + id: assign_issue + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const assignee = context.payload.comment.user.login; + await github.issues.addAssignees({ owner, repo, issue_number: number, assignees: [assignee] }); + console.log(`Assigned the issue to ${assignee}.`); diff --git a/.github/workflows/close_invalid_issue.yml b/.github/workflows/close_invalid_issue.yml index 9687f07851..4d7f8162c6 100644 --- a/.github/workflows/close_invalid_issue.yml +++ b/.github/workflows/close_invalid_issue.yml @@ -1,59 +1,59 @@ -name: Close Issues Without Keywords -on: - issues: - types: - - opened - -jobs: - close-issue: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Close issue without keywords - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const keywords = ['Documentation Bug', 'New game', 'Enhancement', 'Bug', 'Question']; - const issueTitle = context.payload.issue.title ? context.payload.issue.title.toLowerCase() : ''; - const openerUsername = context.payload.issue.user.login; - - let containsKeyword = false; - for (const keyword of keywords) { - if (issueTitle.includes(keyword.toLowerCase())) { - containsKeyword = true; - break; - } - } - - if (!containsKeyword) { - const commentBody = `Hey @${openerUsername}! ๐Ÿ™‚ \n It seems like you are not following proper guidelines !! ๐Ÿ‘€ \n Read documentation properly !!๐Ÿ™ \n If you have any queries reach out to us on [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) .`; - - // Close the issue - await github.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - state: 'closed' - }); - - // Add comment to the issue - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: commentBody - }); - - console.log('Closed the issue and added a comment.'); - } else { - console.log('Issue contains one of the keywords. Skipping...'); - } +name: Close Issues Without Keywords +on: + issues: + types: + - opened + +jobs: + close-issue: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Close issue without keywords + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const keywords = ['Documentation Bug', 'New game', 'Enhancement', 'Bug', 'Question']; + const issueTitle = context.payload.issue.title ? context.payload.issue.title.toLowerCase() : ''; + const openerUsername = context.payload.issue.user.login; + + let containsKeyword = false; + for (const keyword of keywords) { + if (issueTitle.includes(keyword.toLowerCase())) { + containsKeyword = true; + break; + } + } + + if (!containsKeyword) { + const commentBody = `Hey @${openerUsername}! ๐Ÿ™‚ \n It seems like you are not following proper guidelines !! ๐Ÿ‘€ \n Read documentation properly !!๐Ÿ™ \n If you have any queries reach out to us on [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) .`; + + // Close the issue + await github.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + state: 'closed' + }); + + // Add comment to the issue + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: commentBody + }); + + console.log('Closed the issue and added a comment.'); + } else { + console.log('Issue contains one of the keywords. Skipping...'); + } diff --git a/.github/workflows/greet.yml b/.github/workflows/greet.yml index fe570e59b0..a1ef092ce7 100644 --- a/.github/workflows/greet.yml +++ b/.github/workflows/greet.yml @@ -1,53 +1,53 @@ -name: Comment and Label on Issue Opened -on: - issues: - types: - - opened - -jobs: - comment_and_label: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Add comment - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const commentAuthor = context.payload.issue.user.login; - const commentBody = `Hey @${commentAuthor} ! \n Thank you for raising an issue ๐Ÿ’— \n You can self assign the issue by commenting /assign in comment ๐Ÿ˜€ \n Make sure you follow [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) and [CONTRIBUTING GUIDELINES](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) ๐Ÿš€ \n Donโ€™t Forget to โญ our [GameZone๐ŸŽฎ](https://github.com/kunjgit/GameZone)\n Make sure you join our [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) `; - const { owner, repo, number } = context.issue; - - await github.issues.createComment({ - owner: owner, - repo: repo, - issue_number: number, - body: commentBody - }); - - - name: Add label if issue body contains "GSSoC23" - id: check_label - run: | - if [[ $(echo "${{ github.event.issue.body }}" | grep -q "GSSoC23"; echo $?) == 0 ]]; then - echo "::set-output name=add_label::true" - else - echo "::set-output name=add_label::false" - fi - - - name: Add label "GSSoC23" - if: ${{ steps.check_label.outputs.add_label == 'true' }} - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - - await github.issues.addLabels({ - owner: owner, - repo: repo, - issue_number: number, - labels: ["GSSoC23"] - }); +name: Comment and Label on Issue Opened +on: + issues: + types: + - opened + +jobs: + comment_and_label: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Add comment + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const commentAuthor = context.payload.issue.user.login; + const commentBody = `Hey @${commentAuthor} ! \n Thank you for raising an issue ๐Ÿ’— \n You can self assign the issue by commenting /assign in comment ๐Ÿ˜€ \n Make sure you follow [CODE OF CONDUCT](https://github.com/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) and [CONTRIBUTING GUIDELINES](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) ๐Ÿš€ \n Donโ€™t Forget to โญ our [GameZone๐ŸŽฎ](https://github.com/kunjgit/GameZone)\n Make sure you join our [Discord๐Ÿ•น๏ธ](https://discord.gg/fgwk4XZfxG) `; + const { owner, repo, number } = context.issue; + + await github.issues.createComment({ + owner: owner, + repo: repo, + issue_number: number, + body: commentBody + }); + + - name: Add label if issue body contains "GSSoC23" + id: check_label + run: | + if [[ $(echo "${{ github.event.issue.body }}" | grep -q "GSSoC23"; echo $?) == 0 ]]; then + echo "::set-output name=add_label::true" + else + echo "::set-output name=add_label::false" + fi + + - name: Add label "GSSoC23" + if: ${{ steps.check_label.outputs.add_label == 'true' }} + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + + await github.issues.addLabels({ + owner: owner, + repo: repo, + issue_number: number, + labels: ["GSSoC23"] + }); diff --git a/.github/workflows/issue_close_greet.yml b/.github/workflows/issue_close_greet.yml index 8e091174ac..9489218ef4 100644 --- a/.github/workflows/issue_close_greet.yml +++ b/.github/workflows/issue_close_greet.yml @@ -1,22 +1,22 @@ -name: Comment on Issue Closure -on: - issues: - types: - - closed - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on Issue Closure - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const author = context.payload.issue.user.login; - const commentBody = `Hey @${author} ! Thank you so much for your raising the issue๐Ÿ’— \n Itโ€™s all yours, you can come anytime again and make some contributions! ๐Ÿš€ \n Alone, we can do little, but together we can do so much! ๐Ÿ˜‡ - `; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the issue: ${commentBody}.`); +name: Comment on Issue Closure +on: + issues: + types: + - closed + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Comment on Issue Closure + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const author = context.payload.issue.user.login; + const commentBody = `Hey @${author} ! Thank you so much for your raising the issue๐Ÿ’— \n Itโ€™s all yours, you can come anytime again and make some contributions! ๐Ÿš€ \n Alone, we can do little, but together we can do so much! ๐Ÿ˜‡ + `; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the issue: ${commentBody}.`); diff --git a/.github/workflows/level_tags.yml b/.github/workflows/level_tags.yml index caa071ef8d..af3cd065e8 100644 --- a/.github/workflows/level_tags.yml +++ b/.github/workflows/level_tags.yml @@ -1,58 +1,58 @@ -name: Add Tags to Issues -on: - issues: - types: - - opened - -jobs: - add-tags: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Add tags to issues - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { issue } = context.payload; - const { owner, repo } = context.repo; - const { title, body } = issue; - - let tagsToAdd = []; - - // Check if issue text contains "Documentation Bug" - if (body && body.toLowerCase().includes('documentation bug')) { - tagsToAdd.push('level1'); - } - - // Check if issue title contains "Enhancement" - if (title && title.toLowerCase().includes('enhancement')) { - tagsToAdd.push('level2'); - } - - // Check if issue title contains "New game" - if (title && title.toLowerCase().includes('new game')) { - tagsToAdd.push('level3'); - } - - if (tagsToAdd.length > 0) { - // Add tags to the issue - await github.issues.addLabels({ - owner: owner, - repo: repo, - issue_number: issue.number, - labels: tagsToAdd - }); - - console.log(`Added tags ${tagsToAdd.join(', ')} to issue #${issue.number}.`); - } else { - console.log('No tags to add.'); - } +name: Add Tags to Issues +on: + issues: + types: + - opened + +jobs: + add-tags: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Add tags to issues + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { issue } = context.payload; + const { owner, repo } = context.repo; + const { title, body } = issue; + + let tagsToAdd = []; + + // Check if issue text contains "Documentation Bug" + if (body && body.toLowerCase().includes('documentation bug')) { + tagsToAdd.push('level1'); + } + + // Check if issue title contains "Enhancement" + if (title && title.toLowerCase().includes('enhancement')) { + tagsToAdd.push('level2'); + } + + // Check if issue title contains "New game" + if (title && title.toLowerCase().includes('new game')) { + tagsToAdd.push('level3'); + } + + if (tagsToAdd.length > 0) { + // Add tags to the issue + await github.issues.addLabels({ + owner: owner, + repo: repo, + issue_number: issue.number, + labels: tagsToAdd + }); + + console.log(`Added tags ${tagsToAdd.join(', ')} to issue #${issue.number}.`); + } else { + console.log('No tags to add.'); + } diff --git a/.github/workflows/new_game.yml b/.github/workflows/new_game.yml index c67c174576..086747472f 100644 --- a/.github/workflows/new_game.yml +++ b/.github/workflows/new_game.yml @@ -1,44 +1,44 @@ -name: Add New Game Label -on: - issues: - types: - - opened - -jobs: - label: - runs-on: ubuntu-latest - - steps: - - name: Check if issue title contains "New Game" - id: check_title - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const issueTitle = context.payload.issue.title; - const isNewGame = issueTitle.includes('New game'); - console.log(`Issue title: ${issueTitle}`); - console.log(`Is New Game: ${isNewGame}`); - console.log(`Issue Number: ${context.payload.issue.number}`); - console.log(`Issue State: ${context.payload.issue.state}`); - console.log(`Issue URL: ${context.payload.issue.html_url}`); - console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`); - console.log(`Repository URL: ${context.payload.repository.html_url}`); - console.log(`Repository Full Name: ${context.payload.repository.full_name}`); - console.log(`Repository Name: ${context.payload.repository.name}`); - console.log(`Repository Owner: ${context.payload.repository.owner.login}`); - console.log(`Repository Owner URL: ${context.payload.repository.owner.html_url}`); - console.log(`Event Name: ${context.eventName}`); - - core.setOutput('is_new_game', isNewGame.toString()); - - - name: Add "New Game" label - if: steps.check_title.outputs.is_new_game == 'true' - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const label = 'New Game ๐ŸŽฎ'; - await github.issues.addLabels({ owner, repo, issue_number: number, labels: [label] }); - console.log(`Added label "${label}" to the issue.`); +name: Add New Game Label +on: + issues: + types: + - opened + +jobs: + label: + runs-on: ubuntu-latest + + steps: + - name: Check if issue title contains "New Game" + id: check_title + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const issueTitle = context.payload.issue.title; + const isNewGame = issueTitle.includes('New game'); + console.log(`Issue title: ${issueTitle}`); + console.log(`Is New Game: ${isNewGame}`); + console.log(`Issue Number: ${context.payload.issue.number}`); + console.log(`Issue State: ${context.payload.issue.state}`); + console.log(`Issue URL: ${context.payload.issue.html_url}`); + console.log(`Repository: ${context.repo.owner}/${context.repo.repo}`); + console.log(`Repository URL: ${context.payload.repository.html_url}`); + console.log(`Repository Full Name: ${context.payload.repository.full_name}`); + console.log(`Repository Name: ${context.payload.repository.name}`); + console.log(`Repository Owner: ${context.payload.repository.owner.login}`); + console.log(`Repository Owner URL: ${context.payload.repository.owner.html_url}`); + console.log(`Event Name: ${context.eventName}`); + + core.setOutput('is_new_game', isNewGame.toString()); + + - name: Add "New Game" label + if: steps.check_title.outputs.is_new_game == 'true' + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const label = 'New Game ๐ŸŽฎ'; + await github.issues.addLabels({ owner, repo, issue_number: number, labels: [label] }); + console.log(`Added label "${label}" to the issue.`); diff --git a/.github/workflows/pr_close_greet.yml b/.github/workflows/pr_close_greet.yml index 5e0c5347c9..814e727cf7 100644 --- a/.github/workflows/pr_close_greet.yml +++ b/.github/workflows/pr_close_greet.yml @@ -1,22 +1,22 @@ -name: Comment on PR Closure -on: - pull_request_target: - types: - - closed - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on PR Closure - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const commentAuthor = context.payload.pull_request.user.login; - const commentBody = `Thank you @${commentAuthor} , for your valuable time and contribution in our GameZone ๐Ÿ’—. \n Itโ€™s our GameZone, so Letโ€™s build this GameZone altogether !!๐Ÿค\n Hoping to see you soon with another PR again ๐Ÿ˜‡ \n Wishing you all the best for your journey into Open Source๐Ÿš€ - `; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the closed PR: ${commentBody}.`); +name: Comment on PR Closure +on: + pull_request_target: + types: + - closed + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Comment on PR Closure + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const commentAuthor = context.payload.pull_request.user.login; + const commentBody = `Thank you @${commentAuthor} , for your valuable time and contribution in our GameZone ๐Ÿ’—. \n Itโ€™s our GameZone, so Letโ€™s build this GameZone altogether !!๐Ÿค\n Hoping to see you soon with another PR again ๐Ÿ˜‡ \n Wishing you all the best for your journey into Open Source๐Ÿš€ + `; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the closed PR: ${commentBody}.`); diff --git a/.github/workflows/pr_greet.yml b/.github/workflows/pr_greet.yml index 4ebc068efa..eda9dc1a9d 100644 --- a/.github/workflows/pr_greet.yml +++ b/.github/workflows/pr_greet.yml @@ -1,22 +1,22 @@ -name: Comment on PR Creation -on: - pull_request_target: - types: - - opened - -jobs: - comment: - runs-on: ubuntu-latest - - steps: - - name: Comment on PR - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const { owner, repo, number } = context.issue; - const commentAuthor = context.payload.sender.login; - const commentBody = `Thank you @${commentAuthor} ,for creating the PR and contributing to our GameZone ๐Ÿ’— \n Review team will review the PR and will reach out to you soon! ๐Ÿ˜‡ \n Make sure that you have marked all the tasks that you are done with โœ…. \n Thank you for your patience! ๐Ÿ˜€ - `; - await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); - console.log(`Commented on the PR: ${commentBody}.`); +name: Comment on PR Creation +on: + pull_request_target: + types: + - opened + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Comment on PR + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const { owner, repo, number } = context.issue; + const commentAuthor = context.payload.sender.login; + const commentBody = `Thank you @${commentAuthor} ,for creating the PR and contributing to our GameZone ๐Ÿ’— \n Review team will review the PR and will reach out to you soon! ๐Ÿ˜‡ \n Make sure that you have marked all the tasks that you are done with โœ…. \n Thank you for your patience! ๐Ÿ˜€ + `; + await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody }); + console.log(`Commented on the PR: ${commentBody}.`); diff --git a/.github/workflows/remove_duplicate.yml b/.github/workflows/remove_duplicate.yml index 8ec6ce4ff0..a0947dfb39 100644 --- a/.github/workflows/remove_duplicate.yml +++ b/.github/workflows/remove_duplicate.yml @@ -1,117 +1,117 @@ -name: Prevent Duplicate Issues -on: - issues: - types: - - opened - -jobs: - prevent-duplicate-issues: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Install dependencies - run: npm install --prefix .github string-similarity - - - name: Check for duplicate issue - id: check_duplicate - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const newIssueTitle = context.payload.issue.title ? context.payload.issue.title.toLowerCase() : ''; - const newIssueWords = newIssueTitle.split(' '); - - const { data: issues } = await github.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - per_page: 100 // Adjust the per_page value as per your requirements - }); - - const stringSimilarity = require('.github/node_modules/string-similarity'); - let isDuplicate = false; - let duplicateIssueNumber = null; - let similarIssueNumber = null; - - for (const issue of issues) { - if (issue.number === context.issue.number) { - continue; // Skip the current issue being checked - } - - const existingIssueTitle = issue.title ? issue.title.toLowerCase() : ''; - const existingIssueWords = existingIssueTitle.split(' '); - - let matchedWordCount = 0; - for (const word of newIssueWords) { - let maxSimilarity = 0; - for (const existingWord of existingIssueWords) { - const similarity = stringSimilarity.compareTwoStrings(word, existingWord); - if (similarity >= 0.75 && similarity > maxSimilarity) { - maxSimilarity = similarity; - } - } - if (maxSimilarity >= 0.75) { - matchedWordCount++; - } - } - - const similarityPercentage = (matchedWordCount / newIssueWords.length) * 100; - if (similarityPercentage >= 80) { - // Check if both current and similar issues have '[New Game]:' in the title - const hasNewGameTitle = newIssueTitle.includes('[new game]:'); - const hasSimilarNewGameTitle = existingIssueTitle.includes('[new game]:'); - - if (hasNewGameTitle && hasSimilarNewGameTitle) { - isDuplicate = true; - duplicateIssueNumber = issue.number; - similarIssueNumber = issue.number; - break; - } - } - } - - core.setOutput('is_duplicate', isDuplicate.toString()); - core.setOutput('duplicate_issue_number', duplicateIssueNumber ? duplicateIssueNumber.toString() : ''); - core.setOutput('similar_issue_number', similarIssueNumber ? similarIssueNumber.toString() : ''); - - - name: Close duplicate issue and comment - if: steps.check_duplicate.outputs.is_duplicate == 'true' - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - script: | - const duplicateIssueNumber = parseInt('${{ steps.check_duplicate.outputs.duplicate_issue_number }}'); - const { owner, repo } = context.repo; - - // Close the newly created duplicate issue - await github.issues.update({ - owner: owner, - repo: repo, - issue_number: context.issue.number, - state: 'closed' - }); - - // Get the issue opener's username - const openerUsername = context.payload.issue.user.login; - - // Comment on the newly created duplicate issue - await github.issues.createComment({ - owner: owner, - repo: repo, - issue_number: context.issue.number, - body: `Hey @${openerUsername}! \nWe are already having a similar game request in #${duplicateIssueNumber} ๐Ÿ‘€ \nMake sure you come up with a cool unique idea ๐Ÿ˜€ \n Waiting for your new game idea ๐Ÿ’—.` - }); - - console.log(`Closed the duplicate issue #${duplicateIssueNumber}.`); - - - name: Skip if not a duplicate issue - if: steps.check_duplicate.outputs.is_duplicate != 'true' - run: echo "Not a duplicate issue. Skipping..." +name: Prevent Duplicate Issues +on: + issues: + types: + - opened + +jobs: + prevent-duplicate-issues: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install --prefix .github string-similarity + + - name: Check for duplicate issue + id: check_duplicate + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const newIssueTitle = context.payload.issue.title ? context.payload.issue.title.toLowerCase() : ''; + const newIssueWords = newIssueTitle.split(' '); + + const { data: issues } = await github.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + per_page: 100 // Adjust the per_page value as per your requirements + }); + + const stringSimilarity = require('.github/node_modules/string-similarity'); + let isDuplicate = false; + let duplicateIssueNumber = null; + let similarIssueNumber = null; + + for (const issue of issues) { + if (issue.number === context.issue.number) { + continue; // Skip the current issue being checked + } + + const existingIssueTitle = issue.title ? issue.title.toLowerCase() : ''; + const existingIssueWords = existingIssueTitle.split(' '); + + let matchedWordCount = 0; + for (const word of newIssueWords) { + let maxSimilarity = 0; + for (const existingWord of existingIssueWords) { + const similarity = stringSimilarity.compareTwoStrings(word, existingWord); + if (similarity >= 0.75 && similarity > maxSimilarity) { + maxSimilarity = similarity; + } + } + if (maxSimilarity >= 0.75) { + matchedWordCount++; + } + } + + const similarityPercentage = (matchedWordCount / newIssueWords.length) * 100; + if (similarityPercentage >= 80) { + // Check if both current and similar issues have '[New Game]:' in the title + const hasNewGameTitle = newIssueTitle.includes('[new game]:'); + const hasSimilarNewGameTitle = existingIssueTitle.includes('[new game]:'); + + if (hasNewGameTitle && hasSimilarNewGameTitle) { + isDuplicate = true; + duplicateIssueNumber = issue.number; + similarIssueNumber = issue.number; + break; + } + } + } + + core.setOutput('is_duplicate', isDuplicate.toString()); + core.setOutput('duplicate_issue_number', duplicateIssueNumber ? duplicateIssueNumber.toString() : ''); + core.setOutput('similar_issue_number', similarIssueNumber ? similarIssueNumber.toString() : ''); + + - name: Close duplicate issue and comment + if: steps.check_duplicate.outputs.is_duplicate == 'true' + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const duplicateIssueNumber = parseInt('${{ steps.check_duplicate.outputs.duplicate_issue_number }}'); + const { owner, repo } = context.repo; + + // Close the newly created duplicate issue + await github.issues.update({ + owner: owner, + repo: repo, + issue_number: context.issue.number, + state: 'closed' + }); + + // Get the issue opener's username + const openerUsername = context.payload.issue.user.login; + + // Comment on the newly created duplicate issue + await github.issues.createComment({ + owner: owner, + repo: repo, + issue_number: context.issue.number, + body: `Hey @${openerUsername}! \nWe are already having a similar game request in #${duplicateIssueNumber} ๐Ÿ‘€ \nMake sure you come up with a cool unique idea ๐Ÿ˜€ \n Waiting for your new game idea ๐Ÿ’—.` + }); + + console.log(`Closed the duplicate issue #${duplicateIssueNumber}.`); + + - name: Skip if not a duplicate issue + if: steps.check_duplicate.outputs.is_duplicate != 'true' + run: echo "Not a duplicate issue. Skipping..." diff --git a/Games/Aim_Training/README.md b/Games/Aim_Training/README.md index d917955386..5d2a59cd67 100644 --- a/Games/Aim_Training/README.md +++ b/Games/Aim_Training/README.md @@ -1,42 +1,42 @@ -# **Game_Name** - -Aim Training ---- -
- -## **Description ๐Ÿ“ƒ** - -- Aim training game is a simple and addictive game where the player's objective is to pop as many bubbles as possible within a limited time. Colorful bubbles randomly appear on the screen, and the player must quickly click on them to pop them. Each popped bubble earns the player a point, and the score is displayed in real-time. The game lasts for 30 seconds. - -- The player starts the game by clicking the "Start" button. - -- Bubbles start appearing on the screen at regular intervals. - -- The player's goal is to click on the bubbles to pop them. - -- Overall, the game aims to test the player's agility, reflexes, and hand-eye coordination. - -## **functionalities ๐ŸŽฎ** - -- Colorful bubbles appear randomly on the screen at regular intervals. -- The player can click on the bubbles to pop them and earn points. -- The player's score is displayed in real-time, showing the number of bubbles popped. -- The highest score achieved is tracked and displayed as the high score. -
- -## **How to play? ๐Ÿ•น๏ธ** - -- just hit start and there you go. - -
- -## **Screenshots ๐Ÿ“ธ** - -
- - - ![Game image](../../assets/images/Aim_Training.png) -
- - +# **Game_Name** + +Aim Training +--- +
+ +## **Description ๐Ÿ“ƒ** + +- Aim training game is a simple and addictive game where the player's objective is to pop as many bubbles as possible within a limited time. Colorful bubbles randomly appear on the screen, and the player must quickly click on them to pop them. Each popped bubble earns the player a point, and the score is displayed in real-time. The game lasts for 30 seconds. + +- The player starts the game by clicking the "Start" button. + +- Bubbles start appearing on the screen at regular intervals. + +- The player's goal is to click on the bubbles to pop them. + +- Overall, the game aims to test the player's agility, reflexes, and hand-eye coordination. + +## **functionalities ๐ŸŽฎ** + +- Colorful bubbles appear randomly on the screen at regular intervals. +- The player can click on the bubbles to pop them and earn points. +- The player's score is displayed in real-time, showing the number of bubbles popped. +- The highest score achieved is tracked and displayed as the high score. +
+ +## **How to play? ๐Ÿ•น๏ธ** + +- just hit start and there you go. + +
+ +## **Screenshots ๐Ÿ“ธ** + +
+ + + ![Game image](../../assets/images/Aim_Training.png) +
+ + \ No newline at end of file diff --git a/Games/Aim_Training/index.html b/Games/Aim_Training/index.html index ded38c4dd1..2dadbd0c42 100644 --- a/Games/Aim_Training/index.html +++ b/Games/Aim_Training/index.html @@ -1,20 +1,20 @@ - - - - Aim training - - - -

Aim training

-
-
Score: 0
-
High Score: 0
-
Time Left: 30 seconds
-
-
- - - - - - + + + + Aim training + + + +

Aim training

+
+
Score: 0
+
High Score: 0
+
Time Left: 30 seconds
+
+
+ + + + + + diff --git a/Games/Aim_Training/script.js b/Games/Aim_Training/script.js index 6ad2c5876d..3ca8795c92 100644 --- a/Games/Aim_Training/script.js +++ b/Games/Aim_Training/script.js @@ -1,139 +1,139 @@ -// Variables -let score = 0; -let highScore = 0; -let timeLeft = 30; -let timerId; -let level = 1; -let bubbleInterval = 1000; -let gameInProgress = false; // Track if the game is in progress -let bubbleGenerationTimeout; // Store the timeout for bubble generation - -// Function to create a bubble -function createBubble() { - const bubble = document.createElement("div"); - bubble.className = "bubble"; - - // Generate random position - const posX = Math.random() * 500 + 50; - const posY = Math.random() * 300 + 50; - - bubble.style.top = `${posY}px`; - bubble.style.left = `${posX}px`; - - // Generate random size and color - const size = Math.floor(Math.random() * 30) + 20; - const color = `rgb(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255})`; - - bubble.style.width = `${size}px`; - bubble.style.height = `${size}px`; - bubble.style.backgroundColor = color; - - // Event listener to pop the bubble - bubble.addEventListener("click", function () { - if (bubble.parentNode) { - score++; - document.getElementById("scoreValue").textContent = score; - bubble.parentNode.removeChild(bubble); - playPopSound(); - } - }); - - return bubble; -} - -// Function to start the game -function startGame() { - if (gameInProgress) { - return; // Return if game is already in progress - } - - const bubblesContainer = document.getElementById("bubbles"); - const timerElement = document.getElementById("timerValue"); - const startButton = document.getElementById("startButton"); - - // Clear previous bubbles - while (bubblesContainer.firstChild) { - bubblesContainer.firstChild.remove(); - } - - // Reset game state - score = 0; - timeLeft = 30; - level = 1; - bubbleInterval = 1000; - document.getElementById("scoreValue").textContent = score; - document.getElementById("timerValue").textContent = timeLeft; - gameInProgress = true; - - // Start the timer - timerId = setInterval(function () { - timeLeft--; - timerElement.textContent = timeLeft; - - if (timeLeft === 0) { - clearInterval(timerId); - endGame(); - } - }, 1000); - - // Start generating bubbles - generateBubble(bubblesContainer); - - // Disable start button during gameplay - startButton.disabled = true; -} - -// Function to generate bubbles -function generateBubble(container) { - if (!gameInProgress) { - return; // Return if game is not in progress - } - - const bubble = createBubble(); - container.appendChild(bubble); - - // Schedule next bubble generation - bubbleGenerationTimeout = setTimeout(function () { - generateBubble(container); - }, bubbleInterval); -} - -// Function to end the game -function endGame() { - gameInProgress = false; // Set gameInProgress to false - - // Clear bubble generation timeout - clearTimeout(bubbleGenerationTimeout); - - const startButton = document.getElementById("startButton"); - startButton.disabled = false; - playEndSound(); - - // Update high score - if (score > highScore) { - highScore = score; - document.getElementById("highScoreValue").textContent = highScore; - } - - // Display game over message - setTimeout(function () { - alert("Game Over! Your score: " + score); - }, 100); -} - -// Function to play bubble pop sound -function playPopSound() { - const popSound = document.getElementById("popSound"); - popSound.currentTime = 0; - popSound.play(); -} - -// Function to play game end sound -function playEndSound() { - const endSound = document.getElementById("endSound"); - endSound.currentTime = 0; - endSound.play(); -} - -// Event listener for start button -document.getElementById("startButton").addEventListener("click", startGame); +// Variables +let score = 0; +let highScore = 0; +let timeLeft = 30; +let timerId; +let level = 1; +let bubbleInterval = 1000; +let gameInProgress = false; // Track if the game is in progress +let bubbleGenerationTimeout; // Store the timeout for bubble generation + +// Function to create a bubble +function createBubble() { + const bubble = document.createElement("div"); + bubble.className = "bubble"; + + // Generate random position + const posX = Math.random() * 500 + 50; + const posY = Math.random() * 300 + 50; + + bubble.style.top = `${posY}px`; + bubble.style.left = `${posX}px`; + + // Generate random size and color + const size = Math.floor(Math.random() * 30) + 20; + const color = `rgb(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255})`; + + bubble.style.width = `${size}px`; + bubble.style.height = `${size}px`; + bubble.style.backgroundColor = color; + + // Event listener to pop the bubble + bubble.addEventListener("click", function () { + if (bubble.parentNode) { + score++; + document.getElementById("scoreValue").textContent = score; + bubble.parentNode.removeChild(bubble); + playPopSound(); + } + }); + + return bubble; +} + +// Function to start the game +function startGame() { + if (gameInProgress) { + return; // Return if game is already in progress + } + + const bubblesContainer = document.getElementById("bubbles"); + const timerElement = document.getElementById("timerValue"); + const startButton = document.getElementById("startButton"); + + // Clear previous bubbles + while (bubblesContainer.firstChild) { + bubblesContainer.firstChild.remove(); + } + + // Reset game state + score = 0; + timeLeft = 30; + level = 1; + bubbleInterval = 1000; + document.getElementById("scoreValue").textContent = score; + document.getElementById("timerValue").textContent = timeLeft; + gameInProgress = true; + + // Start the timer + timerId = setInterval(function () { + timeLeft--; + timerElement.textContent = timeLeft; + + if (timeLeft === 0) { + clearInterval(timerId); + endGame(); + } + }, 1000); + + // Start generating bubbles + generateBubble(bubblesContainer); + + // Disable start button during gameplay + startButton.disabled = true; +} + +// Function to generate bubbles +function generateBubble(container) { + if (!gameInProgress) { + return; // Return if game is not in progress + } + + const bubble = createBubble(); + container.appendChild(bubble); + + // Schedule next bubble generation + bubbleGenerationTimeout = setTimeout(function () { + generateBubble(container); + }, bubbleInterval); +} + +// Function to end the game +function endGame() { + gameInProgress = false; // Set gameInProgress to false + + // Clear bubble generation timeout + clearTimeout(bubbleGenerationTimeout); + + const startButton = document.getElementById("startButton"); + startButton.disabled = false; + playEndSound(); + + // Update high score + if (score > highScore) { + highScore = score; + document.getElementById("highScoreValue").textContent = highScore; + } + + // Display game over message + setTimeout(function () { + alert("Game Over! Your score: " + score); + }, 100); +} + +// Function to play bubble pop sound +function playPopSound() { + const popSound = document.getElementById("popSound"); + popSound.currentTime = 0; + popSound.play(); +} + +// Function to play game end sound +function playEndSound() { + const endSound = document.getElementById("endSound"); + endSound.currentTime = 0; + endSound.play(); +} + +// Event listener for start button +document.getElementById("startButton").addEventListener("click", startGame); diff --git a/Games/Aim_Training/styles.css b/Games/Aim_Training/styles.css index 9c571b3fce..6799af31e4 100644 --- a/Games/Aim_Training/styles.css +++ b/Games/Aim_Training/styles.css @@ -1,85 +1,85 @@ -body { - text-align: center; -} - -h1 { - color: #333; -} - -#gameContainer { - margin-top: 50px; - position: relative; -} - -#score, -#highScore, -#timer { - font-size: 20px; - color: #333; - margin-bottom: 10px; -} - -#bubbles { - position: relative; - width: 600px; - height: 400px; - margin: 0 auto; - background-color: #ccc; - border: 2px solid #333; - border-radius: 10px; - overflow: hidden; -} - -.bubble { - position: absolute; - width: 50px; - height: 50px; - border-radius: 50%; - background-color: #f00; - cursor: pointer; - transition: top 0.5s ease-in-out, left 0.5s ease-in-out; -} - -.bubble:hover { - background-color: #f00; - transform: scale(1.2); -} - -#scoreValue, -#highScoreValue { - font-weight: bold; -} - -#timerValue { - font-weight: bold; - animation: blink 1s infinite; -} - -.start-button { - padding: 10px 20px; - font-size: 16px; - background-color: #333; - color: #fff; - border: none; - cursor: pointer; - margin-top: 20px; -} - -@keyframes countdown { - 0% { - transform: scale(1); - } - 50% { - transform: scale(1.1); - } - 100% { - transform: scale(1); - } -} - -@media (max-width: 768px) { - #bubbles { - width: 80%; - height: 300px; - } -} +body { + text-align: center; +} + +h1 { + color: #333; +} + +#gameContainer { + margin-top: 50px; + position: relative; +} + +#score, +#highScore, +#timer { + font-size: 20px; + color: #333; + margin-bottom: 10px; +} + +#bubbles { + position: relative; + width: 600px; + height: 400px; + margin: 0 auto; + background-color: #ccc; + border: 2px solid #333; + border-radius: 10px; + overflow: hidden; +} + +.bubble { + position: absolute; + width: 50px; + height: 50px; + border-radius: 50%; + background-color: #f00; + cursor: pointer; + transition: top 0.5s ease-in-out, left 0.5s ease-in-out; +} + +.bubble:hover { + background-color: #f00; + transform: scale(1.2); +} + +#scoreValue, +#highScoreValue { + font-weight: bold; +} + +#timerValue { + font-weight: bold; + animation: blink 1s infinite; +} + +.start-button { + padding: 10px 20px; + font-size: 16px; + background-color: #333; + color: #fff; + border: none; + cursor: pointer; + margin-top: 20px; +} + +@keyframes countdown { + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.1); + } + 100% { + transform: scale(1); + } +} + +@media (max-width: 768px) { + #bubbles { + width: 80%; + height: 300px; + } +} diff --git a/Games/Alien_Shooters/README.md b/Games/Alien_Shooters/README.md index c6af0deaed..8395ea0599 100644 --- a/Games/Alien_Shooters/README.md +++ b/Games/Alien_Shooters/README.md @@ -1,36 +1,36 @@ -# **ALIEN_SHOOTERS** - ---- - -
- -## **Description ๐Ÿ“ƒ** -- A retro styled game testing your reflexes and precision on the keyboard. Your main aim is to shoot as many aliens as you can using the shooter given to you. - - -## **functionalities ๐ŸŽฎ** -- Easy to play -- Scoring system so that you can compare points with your friends. -- Responsive design for most of the monitors. -
- -## **How to play? ๐Ÿ•น๏ธ** -- Your aim is to shoot as many aliens as possible. -- The more you shoot the more they become and faster they approach. -- But shooting 1 aliens gets you 100 points. When you shoot a certain set of aliens, you get bonus points for the same; that is 100 times the number of aliens you just shot. -
- -## **Screenshots ๐Ÿ“ธ** - -
- -![Game image](../../assets/images/Alien_Shooter.png) - -
- -## **Working video ๐Ÿ“น** - - - -https://github.com/singh-anushka/GameZone/assets/93376863/f75000d6-a34a-41b3-8c51-ac817022d576 - +# **ALIEN_SHOOTERS** + +--- + +
+ +## **Description ๐Ÿ“ƒ** +- A retro styled game testing your reflexes and precision on the keyboard. Your main aim is to shoot as many aliens as you can using the shooter given to you. + + +## **functionalities ๐ŸŽฎ** +- Easy to play +- Scoring system so that you can compare points with your friends. +- Responsive design for most of the monitors. +
+ +## **How to play? ๐Ÿ•น๏ธ** +- Your aim is to shoot as many aliens as possible. +- The more you shoot the more they become and faster they approach. +- But shooting 1 aliens gets you 100 points. When you shoot a certain set of aliens, you get bonus points for the same; that is 100 times the number of aliens you just shot. +
+ +## **Screenshots ๐Ÿ“ธ** + +
+ +![Game image](../../assets/images/Alien_Shooter.png) + +
+ +## **Working video ๐Ÿ“น** + + + +https://github.com/singh-anushka/GameZone/assets/93376863/f75000d6-a34a-41b3-8c51-ac817022d576 + diff --git a/Games/Alien_Shooters/index.html b/Games/Alien_Shooters/index.html index a18af5f42f..a788b1a57a 100644 --- a/Games/Alien_Shooters/index.html +++ b/Games/Alien_Shooters/index.html @@ -1,18 +1,18 @@ - - - - - - Alien Shooter - - - - - - - - -

Alien Shooter

- - - + + + + + + Alien Shooter + + + + + + + + +

Alien Shooter

+ + + diff --git a/Games/Alien_Shooters/script.js b/Games/Alien_Shooters/script.js index 7919d71dd7..fe66aba6a9 100644 --- a/Games/Alien_Shooters/script.js +++ b/Games/Alien_Shooters/script.js @@ -1,241 +1,241 @@ -//board -let tileSize = 32; -let rows = 16; -let columns = 16; - -let board; -let boardWidth = tileSize * columns; // 32 * 16 -let boardHeight = tileSize * rows; // 32 * 16 -let context; - -//ship -let shipWidth = tileSize*2; -let shipHeight = tileSize; -let shipX = tileSize * columns/2 - tileSize; -let shipY = tileSize * rows - tileSize*2; - -let ship = { - x : shipX, - y : shipY, - width : shipWidth, - height : shipHeight -} - -let shipImg; -let shipVelocityX = tileSize; //ship moving speed - -//aliens -let alienArray = []; -let alienWidth = tileSize*2; -let alienHeight = tileSize; -let alienX = tileSize; -let alienY = tileSize; -let alienImg; - -let alienRows = 2; -let alienColumns = 3; -let alienCount = 0; //number of aliens to defeat -let alienVelocityX = 1; //alien moving speed - -//bullets -let bulletArray = []; -let bulletVelocityY = -10; //bullet moving speed - -let score = 0; -let gameOver = false; - -window.onload = function() { - board = document.getElementById("board"); - board.width = boardWidth; - board.height = boardHeight; - context = board.getContext("2d"); //used for drawing on the board - - shipImg = new Image(); - shipImg.src = "./assets/shooter.png"; - shipImg.onload = function() { - context.drawImage(shipImg, ship.x, ship.y, ship.width, ship.height); - } - - alienImg = new Image(); - generateAliens(); - createAliens(); - - requestAnimationFrame(update); - document.addEventListener("keydown", moveShip); - document.addEventListener("keyup", shoot); -} - -function generateAliens(){ - var n = Math.floor(Math.random()*4); - alienImg.src = "./assets/" + n + ".png"; -} - -function update() { - requestAnimationFrame(update); - - if(gameOver){ - if(e.code == "Space"){ - resetGame(); - } - return; - } - - context.clearRect(0, 0, board.width, board.height); - - //ship - context.drawImage(shipImg, ship.x, ship.y, ship.width, ship.height); - - //alien - for (let i = 0; i < alienArray.length; i++) { - let alien = alienArray[i]; - if (alien.alive) { - alien.x += alienVelocityX; - - //if alien touches the borders - if (alien.x + alien.width >= board.width || alien.x <= 0) { - alienVelocityX *= -1; - alien.x += alienVelocityX*2; - - //move all aliens up by one row - for (let j = 0; j < alienArray.length; j++) { - alienArray[j].y += alienHeight; - } - } - context.drawImage(alienImg, alien.x, alien.y, alien.width, alien.height); - - if (alien.y >= ship.y) { - gameOver = true; - context.fillStyle = "#F806CC"; - context.font = "30px 'Play'"; - context.fillText("Press 'Space' to Restart", 93, 250); - } - } - } - - //bullets - for (let i = 0; i < bulletArray.length; i++) { - let bullet = bulletArray[i]; - bullet.y += bulletVelocityY; - context.fillStyle="white"; - context.fillRect(bullet.x, bullet.y, bullet.width, bullet.height); - - //bullet collision with aliens - for (let j = 0; j < alienArray.length; j++) { - let alien = alienArray[j]; - if (!bullet.used && alien.alive && detectCollision(bullet, alien)) { - bullet.used = true; - alien.alive = false; - alienCount--; - score += 100; - } - } - } - - //clear bullets - while (bulletArray.length > 0 && (bulletArray[0].used || bulletArray[0].y < 0)) { - bulletArray.shift(); //removes the first element of the array - } - - //next level - if (alienCount == 0) { - //increase the number of aliens in columns and rows by 1 - score += alienColumns * alienRows * 100; //bonus points :) - alienColumns = Math.min(alienColumns + 1, columns/2 -2); //cap at 16/2 -2 = 6 - alienRows = Math.min(alienRows + 1, rows-4); //cap at 16-4 = 12 - if (alienVelocityX > 0) { - alienVelocityX += 0.2; //increase the alien movement speed towards the right - } - else { - alienVelocityX -= 0.2; //increase the alien movement speed towards the left - } - alienArray = []; - bulletArray = []; - createAliens(); - } - - //score - context.font = "23px 'Play' "; - context.fillStyle = "#FFED00"; - context.fillText("Score: ", 5, 20) - context.fillText(score, 75, 20); -} - -function moveShip(e) { - if(gameOver){ - if(e.code == "Space"){ - resetGame(); - } - return; - } - - if (e.code == "ArrowLeft" && ship.x - shipVelocityX >= 0) { - ship.x -= shipVelocityX; //move left one tile - } - else if (e.code == "ArrowRight" && ship.x + shipVelocityX + ship.width <= board.width) { - ship.x += shipVelocityX; //move right one tile - } -} - -function createAliens() { - for (let c = 0; c < alienColumns; c++) { - for (let r = 0; r < alienRows; r++) { - let alien = { - img : alienImg, - x : alienX + c*alienWidth, - y : alienY + r*alienHeight, - width : alienWidth, - height : alienHeight, - alive : true - } - alienArray.push(alien); - } - } - alienCount = alienArray.length; -} - -function shoot(e) { - if(gameOver){ - if(e.code == "Space"){ - resetGame(); - } - return; - } - - if (e.code == "Space") { - //shoot - let bullet = { - x : ship.x + shipWidth*15/32, - y : ship.y, - width : tileSize/8, - height : tileSize/2, - used : false - } - bulletArray.push(bullet); - } -} - -function detectCollision(a, b) { - return a.x < b.x + b.width && //a's top left doesn't reach b's top right - a.x + a.width > b.x && //a's top right passes b's top left - a.y < b.y + b.height && //a's top left doesn't reach b's bottom left - a.y + a.height > b.y; //a's bottom left passes b's top left -} - -function resetGame(){ - score = 0; - gameOver = false; - - ship = { - x : shipX, - y : shipY, - width : shipWidth, - height : shipHeight - } - - alienArray = []; - alienRows = 2; - alienColumns = 3; - generateAliens(); - createAliens(); - alienVelocityX = 1; +//board +let tileSize = 32; +let rows = 16; +let columns = 16; + +let board; +let boardWidth = tileSize * columns; // 32 * 16 +let boardHeight = tileSize * rows; // 32 * 16 +let context; + +//ship +let shipWidth = tileSize*2; +let shipHeight = tileSize; +let shipX = tileSize * columns/2 - tileSize; +let shipY = tileSize * rows - tileSize*2; + +let ship = { + x : shipX, + y : shipY, + width : shipWidth, + height : shipHeight +} + +let shipImg; +let shipVelocityX = tileSize; //ship moving speed + +//aliens +let alienArray = []; +let alienWidth = tileSize*2; +let alienHeight = tileSize; +let alienX = tileSize; +let alienY = tileSize; +let alienImg; + +let alienRows = 2; +let alienColumns = 3; +let alienCount = 0; //number of aliens to defeat +let alienVelocityX = 1; //alien moving speed + +//bullets +let bulletArray = []; +let bulletVelocityY = -10; //bullet moving speed + +let score = 0; +let gameOver = false; + +window.onload = function() { + board = document.getElementById("board"); + board.width = boardWidth; + board.height = boardHeight; + context = board.getContext("2d"); //used for drawing on the board + + shipImg = new Image(); + shipImg.src = "./assets/shooter.png"; + shipImg.onload = function() { + context.drawImage(shipImg, ship.x, ship.y, ship.width, ship.height); + } + + alienImg = new Image(); + generateAliens(); + createAliens(); + + requestAnimationFrame(update); + document.addEventListener("keydown", moveShip); + document.addEventListener("keyup", shoot); +} + +function generateAliens(){ + var n = Math.floor(Math.random()*4); + alienImg.src = "./assets/" + n + ".png"; +} + +function update() { + requestAnimationFrame(update); + + if(gameOver){ + if(e.code == "Space"){ + resetGame(); + } + return; + } + + context.clearRect(0, 0, board.width, board.height); + + //ship + context.drawImage(shipImg, ship.x, ship.y, ship.width, ship.height); + + //alien + for (let i = 0; i < alienArray.length; i++) { + let alien = alienArray[i]; + if (alien.alive) { + alien.x += alienVelocityX; + + //if alien touches the borders + if (alien.x + alien.width >= board.width || alien.x <= 0) { + alienVelocityX *= -1; + alien.x += alienVelocityX*2; + + //move all aliens up by one row + for (let j = 0; j < alienArray.length; j++) { + alienArray[j].y += alienHeight; + } + } + context.drawImage(alienImg, alien.x, alien.y, alien.width, alien.height); + + if (alien.y >= ship.y) { + gameOver = true; + context.fillStyle = "#F806CC"; + context.font = "30px 'Play'"; + context.fillText("Press 'Space' to Restart", 93, 250); + } + } + } + + //bullets + for (let i = 0; i < bulletArray.length; i++) { + let bullet = bulletArray[i]; + bullet.y += bulletVelocityY; + context.fillStyle="white"; + context.fillRect(bullet.x, bullet.y, bullet.width, bullet.height); + + //bullet collision with aliens + for (let j = 0; j < alienArray.length; j++) { + let alien = alienArray[j]; + if (!bullet.used && alien.alive && detectCollision(bullet, alien)) { + bullet.used = true; + alien.alive = false; + alienCount--; + score += 100; + } + } + } + + //clear bullets + while (bulletArray.length > 0 && (bulletArray[0].used || bulletArray[0].y < 0)) { + bulletArray.shift(); //removes the first element of the array + } + + //next level + if (alienCount == 0) { + //increase the number of aliens in columns and rows by 1 + score += alienColumns * alienRows * 100; //bonus points :) + alienColumns = Math.min(alienColumns + 1, columns/2 -2); //cap at 16/2 -2 = 6 + alienRows = Math.min(alienRows + 1, rows-4); //cap at 16-4 = 12 + if (alienVelocityX > 0) { + alienVelocityX += 0.2; //increase the alien movement speed towards the right + } + else { + alienVelocityX -= 0.2; //increase the alien movement speed towards the left + } + alienArray = []; + bulletArray = []; + createAliens(); + } + + //score + context.font = "23px 'Play' "; + context.fillStyle = "#FFED00"; + context.fillText("Score: ", 5, 20) + context.fillText(score, 75, 20); +} + +function moveShip(e) { + if(gameOver){ + if(e.code == "Space"){ + resetGame(); + } + return; + } + + if (e.code == "ArrowLeft" && ship.x - shipVelocityX >= 0) { + ship.x -= shipVelocityX; //move left one tile + } + else if (e.code == "ArrowRight" && ship.x + shipVelocityX + ship.width <= board.width) { + ship.x += shipVelocityX; //move right one tile + } +} + +function createAliens() { + for (let c = 0; c < alienColumns; c++) { + for (let r = 0; r < alienRows; r++) { + let alien = { + img : alienImg, + x : alienX + c*alienWidth, + y : alienY + r*alienHeight, + width : alienWidth, + height : alienHeight, + alive : true + } + alienArray.push(alien); + } + } + alienCount = alienArray.length; +} + +function shoot(e) { + if(gameOver){ + if(e.code == "Space"){ + resetGame(); + } + return; + } + + if (e.code == "Space") { + //shoot + let bullet = { + x : ship.x + shipWidth*15/32, + y : ship.y, + width : tileSize/8, + height : tileSize/2, + used : false + } + bulletArray.push(bullet); + } +} + +function detectCollision(a, b) { + return a.x < b.x + b.width && //a's top left doesn't reach b's top right + a.x + a.width > b.x && //a's top right passes b's top left + a.y < b.y + b.height && //a's top left doesn't reach b's bottom left + a.y + a.height > b.y; //a's bottom left passes b's top left +} + +function resetGame(){ + score = 0; + gameOver = false; + + ship = { + x : shipX, + y : shipY, + width : shipWidth, + height : shipHeight + } + + alienArray = []; + alienRows = 2; + alienColumns = 3; + generateAliens(); + createAliens(); + alienVelocityX = 1; } \ No newline at end of file diff --git a/Games/Alien_Shooters/style.css b/Games/Alien_Shooters/style.css index c4e58c8f2b..a84c706e64 100644 --- a/Games/Alien_Shooters/style.css +++ b/Games/Alien_Shooters/style.css @@ -1,19 +1,19 @@ -body { - background-color: #393E46; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - text-align: center; -} - -h1{ - color: #00B7C2; - font-family: 'Press Start 2P', cursive; -} - -#board { - background-color: #212121; - width: 700px; - height: 700px; +body { + background-color: #393E46; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; +} + +h1{ + color: #00B7C2; + font-family: 'Press Start 2P', cursive; +} + +#board { + background-color: #212121; + width: 700px; + height: 700px; } \ No newline at end of file diff --git a/Games/Alphabet/README.md b/Games/Alphabet/README.md index bc2b631a68..ac5e125022 100644 --- a/Games/Alphabet/README.md +++ b/Games/Alphabet/README.md @@ -1,26 +1,26 @@ -# **Alphabet** - ---- - -
- -## **Description ๐Ÿ“ƒ** -The project is designed to help children learn the alphabet in an interactive and engaging way. - -- - -## **functionalities ๐ŸŽฎ** -The project features a user interface that displays all the alphabets from A to Z, accompanied by corresponding images. When a child clicks on a specific alphabet or types a single alphabet, a corresponding sound is played. For example, if the child clicks on the letter 'A', a sound saying "A for apple" will be played. - -The purpose of this project is to provide a fun and educational tool for children to learn and familiarize themselves with the alphabet. By associating each letter with a visual representation and an auditory cue, it aims to enhance their understanding and retention of the alphabet. -- -
- - -## **Screenshots ๐Ÿ“ธ** - -
- -[Alphabet](https://github.com/kunjgit/GameZone/blob/main/assets/images/Alphabet.png) - -
+# **Alphabet** + +--- + +
+ +## **Description ๐Ÿ“ƒ** +The project is designed to help children learn the alphabet in an interactive and engaging way. + +- + +## **functionalities ๐ŸŽฎ** +The project features a user interface that displays all the alphabets from A to Z, accompanied by corresponding images. When a child clicks on a specific alphabet or types a single alphabet, a corresponding sound is played. For example, if the child clicks on the letter 'A', a sound saying "A for apple" will be played. + +The purpose of this project is to provide a fun and educational tool for children to learn and familiarize themselves with the alphabet. By associating each letter with a visual representation and an auditory cue, it aims to enhance their understanding and retention of the alphabet. +- +
+ + +## **Screenshots ๐Ÿ“ธ** + +
+ +[Alphabet](https://github.com/kunjgit/GameZone/blob/main/assets/images/Alphabet.png) + +
diff --git a/Games/Alphabet/index.html b/Games/Alphabet/index.html index 5274237fbd..8d35ebb2ab 100644 --- a/Games/Alphabet/index.html +++ b/Games/Alphabet/index.html @@ -1,48 +1,48 @@ - - - - - Alphabet - - - - -

ALPHABET

-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - + + + + + Alphabet + + + + +

ALPHABET

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + diff --git a/Games/Alphabet/index.js b/Games/Alphabet/index.js index 48c4bcfffe..eda2481582 100644 --- a/Games/Alphabet/index.js +++ b/Games/Alphabet/index.js @@ -1,13 +1,13 @@ -$(".btn").keypress(function(event) { - playSound(event.key); -}); - -$(".btn").click(function() { - var buttonInnerHTML = $(this).attr("id"); - playSound(buttonInnerHTML); -}); - -function playSound(name){ - var audio = new Audio("sounds/" + name + ".mp3"); - audio.play(); -} +$(".btn").keypress(function(event) { + playSound(event.key); +}); + +$(".btn").click(function() { + var buttonInnerHTML = $(this).attr("id"); + playSound(buttonInnerHTML); +}); + +function playSound(name){ + var audio = new Audio("sounds/" + name + ".mp3"); + audio.play(); +} diff --git a/Games/Alphabet/styles.css b/Games/Alphabet/styles.css index 9957d15862..e73a4fe692 100644 --- a/Games/Alphabet/styles.css +++ b/Games/Alphabet/styles.css @@ -1,138 +1,138 @@ -body{ - background-color: #0C0B0C; -} - -/* #0C0B0C */ - -h1 { - font-family: Serif; - font-size: 4rem; - color: #FEE6ED; - text-align: center; -} - -.btns { - -} - -.btn { - outline: none; - border: 10px solid #FEE6ED; - font-size: 5rem; - font-family: Serif; - line-height: 2; - font-weight: 900; - color: #FEE6ED; - /*text-shadow: 3px 0 #DBEDF3;*/ - border-radius: 15px; - display: inline-block; - width: 150px; - height: 150px; - text-align: center; - margin: 10px; - background-color: #0C0B0C; -} - -.a { - background-image: url("images/apple.png"); -} - -.b { - background-image: url("images/ball.png"); -} - -.c { - background-image: url("images/cat.png"); -} - -.d { - background-image: url("images/dog.png"); -} - -.e { - background-image: url("images/elephant.png"); -} - -.f { - background-image: url("images/fish.png"); -} - -.g { - background-image: url("images/grass.png"); -} - -.h { - background-image: url("images/hat.png"); -} - -.i { - background-image: url("images/insect.png"); -} - -.j { - background-image: url("images/jar.png"); -} - -.k { - background-image: url("images/kite.png"); -} - -.l { - background-image: url("images/lamp.png"); -} - -.m { - background-image: url("images/monkey.png"); -} - -.n { - background-image: url("images/nose.png"); -} - -.o { - background-image: url("images/ocean.png"); -} - -.p { - background-image: url("images/parrot.png"); -} - -.q { - background-image: url("images/queen.png"); -} - -.r { - background-image: url("images/rat.png"); -} - -.s { - background-image: url("images/sun.png"); -} - -.t { - background-image: url("images/tap.png"); -} - -.u { - background-image: url("images/umbrella.png"); -} - -.v { - background-image: url("images/violin.png"); -} - -.w { - background-image: url("images/water.png"); -} - -.x { - background-image: url("images/fox.png"); -} - -.y { - background-image: url("images/yellow.png"); -} - -.z { - background-image: url("images/zebra.png"); -} +body{ + background-color: #0C0B0C; +} + +/* #0C0B0C */ + +h1 { + font-family: Serif; + font-size: 4rem; + color: #FEE6ED; + text-align: center; +} + +.btns { + +} + +.btn { + outline: none; + border: 10px solid #FEE6ED; + font-size: 5rem; + font-family: Serif; + line-height: 2; + font-weight: 900; + color: #FEE6ED; + /*text-shadow: 3px 0 #DBEDF3;*/ + border-radius: 15px; + display: inline-block; + width: 150px; + height: 150px; + text-align: center; + margin: 10px; + background-color: #0C0B0C; +} + +.a { + background-image: url("images/apple.png"); +} + +.b { + background-image: url("images/ball.png"); +} + +.c { + background-image: url("images/cat.png"); +} + +.d { + background-image: url("images/dog.png"); +} + +.e { + background-image: url("images/elephant.png"); +} + +.f { + background-image: url("images/fish.png"); +} + +.g { + background-image: url("images/grass.png"); +} + +.h { + background-image: url("images/hat.png"); +} + +.i { + background-image: url("images/insect.png"); +} + +.j { + background-image: url("images/jar.png"); +} + +.k { + background-image: url("images/kite.png"); +} + +.l { + background-image: url("images/lamp.png"); +} + +.m { + background-image: url("images/monkey.png"); +} + +.n { + background-image: url("images/nose.png"); +} + +.o { + background-image: url("images/ocean.png"); +} + +.p { + background-image: url("images/parrot.png"); +} + +.q { + background-image: url("images/queen.png"); +} + +.r { + background-image: url("images/rat.png"); +} + +.s { + background-image: url("images/sun.png"); +} + +.t { + background-image: url("images/tap.png"); +} + +.u { + background-image: url("images/umbrella.png"); +} + +.v { + background-image: url("images/violin.png"); +} + +.w { + background-image: url("images/water.png"); +} + +.x { + background-image: url("images/fox.png"); +} + +.y { + background-image: url("images/yellow.png"); +} + +.z { + background-image: url("images/zebra.png"); +} diff --git a/Games/Atari_breakout/README.md b/Games/Atari_breakout/README.md index a2a1e1b2ff..48b3036c99 100644 --- a/Games/Atari_breakout/README.md +++ b/Games/Atari_breakout/README.md @@ -1,31 +1,31 @@ -# **Atari Breakout** ---- - -## **Description ๐Ÿ“ƒ** -- This a fun game clone of a very popular game called as atari breakout. Not only being great recreational source, it also acts as a great way of increasing responsiveness and estimation capacity of the player. - -## **functionalities ๐ŸŽฎ** -- to be played on desktop. -
- -## **How to play? ๐Ÿ•น๏ธ** -- The game will start with ball at the center, and a total 3 game lives. -- Your role is to use the paddle at the bottom and hit the ball, so that the ball hits and smashed the bricks on the top. -- Try not to let the ball touch the ground; if happens so, then a one of the game lives will be reduced. -- If all the game lives are exhausted, then you lose ๐Ÿ™. -- If all the bricks are smashed the you Win! -
- -## **Screenshots ๐Ÿ“ธ** - -
- -![image](../../assets/images/Atari_breakout.png) - -
- -## **Working video ๐Ÿ“น** - - -https://github.com/singh-anushka/GameZone/assets/93376863/cf2523db-0d97-4e17-93e5-cc465dc63847 - +# **Atari Breakout** +--- + +## **Description ๐Ÿ“ƒ** +- This a fun game clone of a very popular game called as atari breakout. Not only being great recreational source, it also acts as a great way of increasing responsiveness and estimation capacity of the player. + +## **functionalities ๐ŸŽฎ** +- to be played on desktop. +
+ +## **How to play? ๐Ÿ•น๏ธ** +- The game will start with ball at the center, and a total 3 game lives. +- Your role is to use the paddle at the bottom and hit the ball, so that the ball hits and smashed the bricks on the top. +- Try not to let the ball touch the ground; if happens so, then a one of the game lives will be reduced. +- If all the game lives are exhausted, then you lose ๐Ÿ™. +- If all the bricks are smashed the you Win! +
+ +## **Screenshots ๐Ÿ“ธ** + +
+ +![image](../../assets/images/Atari_breakout.png) + +
+ +## **Working video ๐Ÿ“น** + + +https://github.com/singh-anushka/GameZone/assets/93376863/cf2523db-0d97-4e17-93e5-cc465dc63847 + diff --git a/Games/Atari_breakout/index.html b/Games/Atari_breakout/index.html index 7a993874af..2e0437cbcf 100644 --- a/Games/Atari_breakout/index.html +++ b/Games/Atari_breakout/index.html @@ -1,18 +1,18 @@ - - - - - - - Atari Breakout - - - - - - - -

Atari Breakout

- - + + + + + + + Atari Breakout + + + + + + + +

Atari Breakout

+ + \ No newline at end of file diff --git a/Games/Atari_breakout/script.js b/Games/Atari_breakout/script.js index 8030123ec8..0328d2c128 100644 --- a/Games/Atari_breakout/script.js +++ b/Games/Atari_breakout/script.js @@ -1,256 +1,256 @@ -// height and width of the board -let board; -let boardHeight = 500; -let boardWidth = 500; -let context; - -//player -let playerWidth = 80; -let playerHeight = 10; -let playerVelocityX = 20; - -let player = { - x : (boardWidth - playerWidth)/2, - y : (boardHeight - playerHeight) - 5, - width : playerWidth, - height : playerHeight, - velocityX : playerVelocityX -} - -//ball -let ballWidth = 10; -let ballHeight = 10; -let ballVelocityX = 3; -let ballVelocityY = 2; - -let ball = { - x : boardWidth/2, - y : boardHeight/2, - width : ballWidth, - height : ballHeight, - velocityX : ballVelocityX, - velocityY : ballVelocityY -} - -//blocks -let blockArray = []; -let blockWidth = 50; -let blockHeight = 10; -let blockColumns = 8; -let blockRows = 5; -let blockCount = 0; - -let blockX = 15; -let blockY = 45; - -let score = 0; -let gameOver = false; - -//lives -let livesImg = new Image(); -livesImg.src = "./assets/lives.png"; -let lives = 3; - -window.onload = function() { - board = document.getElementById("board"); - board.height = boardHeight; - board.width = boardWidth; - context = board.getContext("2d"); //used for drawing on the board - - // draw the initial player - context.fillStyle = "#FFED00"; - context.fillRect(player.x, player.y, player.width, player.height); - - requestAnimationFrame(update); - document.addEventListener("keydown", movePlayer); - - createBlocks(); -} - -function update(){ - requestAnimationFrame(update); - if(gameOver) return; - context.clearRect(0, 0, board.width, board.height); - - //player - context.fillStyle = "#FFED00"; - context.fillRect(player.x, player.y, player.width, player.height); - - //ball - context.fillStyle = "#FF5F9E"; - ball.x += ball.velocityX; - ball.y += ball.velocityY; - context.fillRect(ball.x, ball.y, ball.width, ball.height); - - - //bouncing ball - // over wall - if(ball.y <= 0 ){ - // if ball touches top - ball.velocityY *= -1; - } - else if(ball.x <= 0 || ((ball.x + ball.width) >= boardWidth)){ - //if ball touches the sides - ball.velocityX *= -1; - } - else if((ball.y + ball.height) >= boardHeight){ - context.font = "20px 'Play' "; - lives--; - if(lives == 0){ - context.fillStyle = "#39B5E0"; - context.fillText("Game Over: Press 'Space' to Restart", 85, 280); - gameOver = true; - } - else{ - ball = { - x : boardWidth/2, - y : boardHeight/2, - width : ballWidth, - height : ballHeight, - velocityX : ballVelocityX, - velocityY : ballVelocityY - } - } - } - - // over paddle - if(topCollision(ball, player) || bottomCollision(ball, player)){ - ball.velocityY *= -1; - } - else if(leftCollision(ball, player) || rightCollision(ball, player)){ - ballVelocityX *= -1; - } - - //blocks - context.fillStyle = "#B3005E"; - for(let i=0; i< blockArray.length; i++){ - let block = blockArray[i]; - if(!block.break){ - if(topCollision(ball, block) || bottomCollision(ball, block)){ - block.break = true; - ball.velocityY *= -1; - blockCount -= 1; - score += 100; - } - else if(leftCollision(ball, block) || rightCollision(ball, block)){ - block.break = true; - ball.velocityX *= -1; - blockCount -= 1; - score += 100; - } - context.fillRect(block.x, block.y, block.width, block.height); - } - } - - //winning condition - if(blockCount == 0){ - context.font = "20px 'Play' "; - context.fillStyle = "#39B5E0"; - context.fillText("You Win!", 200, 200); - context.fillText("Your final score is: ", 140, 230); - context.fillText(score, 310, 230); - context.fillText("Press 'Space' to Restart", 140, 260); - gameOver = true; - } - - //score - context.font = "20px 'Play' "; - context.fillStyle = "#39B5E0"; - context.fillText("Score: ", 10, 25); - context.fillText(score, 75, 25); - - context.drawImage(livesImg, 430, 7, 35, 25); - context.fillText(": ", 458, 24); - context.fillText(lives, 468, 25); -} - -function outOfBounds(xPosition){ - return ((xPosition < 0) || (xPosition + playerWidth > boardWidth)); -} - -function movePlayer(e){ - if(gameOver){ - if(e.code == "Space"){ - resetGame(); - } - return; - } - if(e.code == "ArrowLeft"){ - // player.x -= player.velocityX; - let nextPlayerX = player.x - player.velocityX; - if(!outOfBounds(nextPlayerX)) player.x = nextPlayerX; - - } - else if(e.code == "ArrowRight"){ - let nextPlayerX = player.x + player.velocityX; - if(!outOfBounds(nextPlayerX)) player.x = nextPlayerX; - } - -} - -function detectCollision(a, b){ - return a.x < b.x + b.width && //a's top left corner doesn't reach b's top right corner - a.x + a.width > b.x && //a's top right corner passes b's top left corner - a.y < b.y + b.height && //a's top left corner doesn't reach b's bottom left corner - a.y + a.height > b.y; //a's bottom left corner passes b's top left corner -} - -function topCollision(ball, block){ // a = ball and b = block - return detectCollision(ball, block) && ((ball.y + ball.height) >= block.y); -} - -function bottomCollision(ball, block){ - return detectCollision(ball, block) &&((block.y + block.height) >= ball.y); -} - -function leftCollision(ball, block){ - return detectCollision(ball, block) && ((ball.x + ball.width) >= block.x); -} - -function rightCollision(ball, block){ - return detectCollision(ball, block) && ((block.x + block.width) >= ball.x); -} - -function createBlocks(){ - blockArray = []; - for(let c = 0; c < blockColumns; c++){ - for(let r = 0; r < blockRows; r++){ - let block = { - x : blockX + c*blockWidth + c*10, - y : blockY + r*blockHeight + r*10, - width : blockWidth, - height : blockHeight, - break : false - } - blockArray.push(block); - } - } - blockCount = blockArray.length; - -} - -function resetGame(){ - gameOver = false; - player = { - x : (boardWidth - playerWidth)/2, - y : (boardHeight - playerHeight) - 5, - width : playerWidth, - height : playerHeight, - velocityX : playerVelocityX - } - - ball = { - x : boardWidth/2, - y : boardHeight/2, - width : ballWidth, - height : ballHeight, - velocityX : ballVelocityX, - velocityY : ballVelocityY - } - - blockArray = []; - blockRows = 5; - score = 0; - lives = 3; - createBlocks(); +// height and width of the board +let board; +let boardHeight = 500; +let boardWidth = 500; +let context; + +//player +let playerWidth = 80; +let playerHeight = 10; +let playerVelocityX = 20; + +let player = { + x : (boardWidth - playerWidth)/2, + y : (boardHeight - playerHeight) - 5, + width : playerWidth, + height : playerHeight, + velocityX : playerVelocityX +} + +//ball +let ballWidth = 10; +let ballHeight = 10; +let ballVelocityX = 3; +let ballVelocityY = 2; + +let ball = { + x : boardWidth/2, + y : boardHeight/2, + width : ballWidth, + height : ballHeight, + velocityX : ballVelocityX, + velocityY : ballVelocityY +} + +//blocks +let blockArray = []; +let blockWidth = 50; +let blockHeight = 10; +let blockColumns = 8; +let blockRows = 5; +let blockCount = 0; + +let blockX = 15; +let blockY = 45; + +let score = 0; +let gameOver = false; + +//lives +let livesImg = new Image(); +livesImg.src = "./assets/lives.png"; +let lives = 3; + +window.onload = function() { + board = document.getElementById("board"); + board.height = boardHeight; + board.width = boardWidth; + context = board.getContext("2d"); //used for drawing on the board + + // draw the initial player + context.fillStyle = "#FFED00"; + context.fillRect(player.x, player.y, player.width, player.height); + + requestAnimationFrame(update); + document.addEventListener("keydown", movePlayer); + + createBlocks(); +} + +function update(){ + requestAnimationFrame(update); + if(gameOver) return; + context.clearRect(0, 0, board.width, board.height); + + //player + context.fillStyle = "#FFED00"; + context.fillRect(player.x, player.y, player.width, player.height); + + //ball + context.fillStyle = "#FF5F9E"; + ball.x += ball.velocityX; + ball.y += ball.velocityY; + context.fillRect(ball.x, ball.y, ball.width, ball.height); + + + //bouncing ball + // over wall + if(ball.y <= 0 ){ + // if ball touches top + ball.velocityY *= -1; + } + else if(ball.x <= 0 || ((ball.x + ball.width) >= boardWidth)){ + //if ball touches the sides + ball.velocityX *= -1; + } + else if((ball.y + ball.height) >= boardHeight){ + context.font = "20px 'Play' "; + lives--; + if(lives == 0){ + context.fillStyle = "#39B5E0"; + context.fillText("Game Over: Press 'Space' to Restart", 85, 280); + gameOver = true; + } + else{ + ball = { + x : boardWidth/2, + y : boardHeight/2, + width : ballWidth, + height : ballHeight, + velocityX : ballVelocityX, + velocityY : ballVelocityY + } + } + } + + // over paddle + if(topCollision(ball, player) || bottomCollision(ball, player)){ + ball.velocityY *= -1; + } + else if(leftCollision(ball, player) || rightCollision(ball, player)){ + ballVelocityX *= -1; + } + + //blocks + context.fillStyle = "#B3005E"; + for(let i=0; i< blockArray.length; i++){ + let block = blockArray[i]; + if(!block.break){ + if(topCollision(ball, block) || bottomCollision(ball, block)){ + block.break = true; + ball.velocityY *= -1; + blockCount -= 1; + score += 100; + } + else if(leftCollision(ball, block) || rightCollision(ball, block)){ + block.break = true; + ball.velocityX *= -1; + blockCount -= 1; + score += 100; + } + context.fillRect(block.x, block.y, block.width, block.height); + } + } + + //winning condition + if(blockCount == 0){ + context.font = "20px 'Play' "; + context.fillStyle = "#39B5E0"; + context.fillText("You Win!", 200, 200); + context.fillText("Your final score is: ", 140, 230); + context.fillText(score, 310, 230); + context.fillText("Press 'Space' to Restart", 140, 260); + gameOver = true; + } + + //score + context.font = "20px 'Play' "; + context.fillStyle = "#39B5E0"; + context.fillText("Score: ", 10, 25); + context.fillText(score, 75, 25); + + context.drawImage(livesImg, 430, 7, 35, 25); + context.fillText(": ", 458, 24); + context.fillText(lives, 468, 25); +} + +function outOfBounds(xPosition){ + return ((xPosition < 0) || (xPosition + playerWidth > boardWidth)); +} + +function movePlayer(e){ + if(gameOver){ + if(e.code == "Space"){ + resetGame(); + } + return; + } + if(e.code == "ArrowLeft"){ + // player.x -= player.velocityX; + let nextPlayerX = player.x - player.velocityX; + if(!outOfBounds(nextPlayerX)) player.x = nextPlayerX; + + } + else if(e.code == "ArrowRight"){ + let nextPlayerX = player.x + player.velocityX; + if(!outOfBounds(nextPlayerX)) player.x = nextPlayerX; + } + +} + +function detectCollision(a, b){ + return a.x < b.x + b.width && //a's top left corner doesn't reach b's top right corner + a.x + a.width > b.x && //a's top right corner passes b's top left corner + a.y < b.y + b.height && //a's top left corner doesn't reach b's bottom left corner + a.y + a.height > b.y; //a's bottom left corner passes b's top left corner +} + +function topCollision(ball, block){ // a = ball and b = block + return detectCollision(ball, block) && ((ball.y + ball.height) >= block.y); +} + +function bottomCollision(ball, block){ + return detectCollision(ball, block) &&((block.y + block.height) >= ball.y); +} + +function leftCollision(ball, block){ + return detectCollision(ball, block) && ((ball.x + ball.width) >= block.x); +} + +function rightCollision(ball, block){ + return detectCollision(ball, block) && ((block.x + block.width) >= ball.x); +} + +function createBlocks(){ + blockArray = []; + for(let c = 0; c < blockColumns; c++){ + for(let r = 0; r < blockRows; r++){ + let block = { + x : blockX + c*blockWidth + c*10, + y : blockY + r*blockHeight + r*10, + width : blockWidth, + height : blockHeight, + break : false + } + blockArray.push(block); + } + } + blockCount = blockArray.length; + +} + +function resetGame(){ + gameOver = false; + player = { + x : (boardWidth - playerWidth)/2, + y : (boardHeight - playerHeight) - 5, + width : playerWidth, + height : playerHeight, + velocityX : playerVelocityX + } + + ball = { + x : boardWidth/2, + y : boardHeight/2, + width : ballWidth, + height : ballHeight, + velocityX : ballVelocityX, + velocityY : ballVelocityY + } + + blockArray = []; + blockRows = 5; + score = 0; + lives = 3; + createBlocks(); } \ No newline at end of file diff --git a/Games/Atari_breakout/styles.css b/Games/Atari_breakout/styles.css index 938e815f4a..377ba01ee4 100644 --- a/Games/Atari_breakout/styles.css +++ b/Games/Atari_breakout/styles.css @@ -1,21 +1,21 @@ -body{ - text-align: center; - background-color: #191825; - display: flex; - flex-direction: column; - align-items: center; - justify-content: space-around; - height: 100vh; -} -h1{ - font-family: 'Press Start 2P', cursive; - color: #865DFF; - font-size: 45pt; -} -#board{ - background-color: black; - border: 5px solid #0F6292; - border-bottom: 0px; - height: 600px; - width: 600px; +body{ + text-align: center; + background-color: #191825; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + height: 100vh; +} +h1{ + font-family: 'Press Start 2P', cursive; + color: #865DFF; + font-size: 45pt; +} +#board{ + background-color: black; + border: 5px solid #0F6292; + border-bottom: 0px; + height: 600px; + width: 600px; } \ No newline at end of file diff --git a/Games/Black_Jack/README.md b/Games/Black_Jack/README.md index 81f83a824e..b2e435a5d2 100644 --- a/Games/Black_Jack/README.md +++ b/Games/Black_Jack/README.md @@ -1,44 +1,44 @@ -# **Black Jack Card Game** - ---- - -
- -## **Description ๐Ÿ“ƒ** -- This game is built to develop strategic thinking along with recreation. -- This project is built on a basic web tech stacks such as HTML, CSS and Javascript. - -## **functionalities ๐ŸŽฎ** -- Shuffling of cards. -- Initializing scores at start of the game and score calculation after every "hit". -- Comparing and returning score and verdict after "stay" is clicked. -
- -## **How to play? ๐Ÿ•น๏ธ** -- The game will start 2 cards given to you and a buddle of cards whose sum is at least 17 to the dealer and a hidden card. -- Your job is to click the "hit" button to get new cards. If the sum of cards becomes greater than or equal to 21, "hit" is inactivated; then press "stay". "Stay" can also be pressed while "hit" is active too. -- How score is calculated? - - 1. Number Cards - Score for each card is the same as the number given on the card. - 2. King, Queen, Jack - Score for each card is 10. - 3. Ace - Score for each card is either 1 or 11, as per player's(your or dealer) convenience. - -- How final outcomes are decided? - - 1. Your score greater than 21 - Lose - 2. Your score is less than 21 but dealer's score is greater tha 21 - Win - 3. Both their scores are less than 21 - One with the higher score Wins - -
- -## **Screenshots ๐Ÿ“ธ** - -
- -![image](../../assets/images/Black_Jack.png) - -
- -## **Working video ๐Ÿ“น** - -https://github.com/singh-anushka/GameZone/assets/93376863/8c30ee76-5777-41eb-8f72-9ee59be45955 +# **Black Jack Card Game** + +--- + +
+ +## **Description ๐Ÿ“ƒ** +- This game is built to develop strategic thinking along with recreation. +- This project is built on a basic web tech stacks such as HTML, CSS and Javascript. + +## **functionalities ๐ŸŽฎ** +- Shuffling of cards. +- Initializing scores at start of the game and score calculation after every "hit". +- Comparing and returning score and verdict after "stay" is clicked. +
+ +## **How to play? ๐Ÿ•น๏ธ** +- The game will start 2 cards given to you and a buddle of cards whose sum is at least 17 to the dealer and a hidden card. +- Your job is to click the "hit" button to get new cards. If the sum of cards becomes greater than or equal to 21, "hit" is inactivated; then press "stay". "Stay" can also be pressed while "hit" is active too. +- How score is calculated? + + 1. Number Cards - Score for each card is the same as the number given on the card. + 2. King, Queen, Jack - Score for each card is 10. + 3. Ace - Score for each card is either 1 or 11, as per player's(your or dealer) convenience. + +- How final outcomes are decided? + + 1. Your score greater than 21 - Lose + 2. Your score is less than 21 but dealer's score is greater tha 21 - Win + 3. Both their scores are less than 21 - One with the higher score Wins + +
+ +## **Screenshots ๐Ÿ“ธ** + +
+ +![image](../../assets/images/Black_Jack.png) + +
+ +## **Working video ๐Ÿ“น** + +https://github.com/singh-anushka/GameZone/assets/93376863/8c30ee76-5777-41eb-8f72-9ee59be45955 diff --git a/Games/Black_Jack/index.html b/Games/Black_Jack/index.html index 6e4dbcd6c0..0dd8ba594e 100644 --- a/Games/Black_Jack/index.html +++ b/Games/Black_Jack/index.html @@ -1,40 +1,40 @@ - - - - - - - - Black Jack - - - - - - - - -
-

Black Jack

-

Dealer :

-
- -
-
- -
-

You :

-
-
- -
- -
- - -

-
- - - + + + + + + + + Black Jack + + + + + + + + +
+

Black Jack

+

Dealer :

+
+ +
+
+ +
+

You :

+
+
+ +
+ +
+ + +

+
+ + + \ No newline at end of file diff --git a/Games/Black_Jack/script.js b/Games/Black_Jack/script.js index 186072a2f3..cdf539f7e9 100644 --- a/Games/Black_Jack/script.js +++ b/Games/Black_Jack/script.js @@ -1,126 +1,126 @@ -var dealerSum = 0; -var yourSum = 0; - -// count the number of aces, to track the value of aces. -var dealerAceCount = 0; -var yourAceCount = 0; - -var hidden; //track hidden card of the dealer -var deck; - -var canHit = true; //allows you to draw while yourSum <= 21 - -window.onload = function() { - buildDeck(); - shuffleDeck(); - startGame(); -} - -function buildDeck(){ - let values = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]; - let types = ["C", "D", "H", "S"]; - deck = []; - - for (let i=0; i < types.length; i++){ - for(let j=0; j< values.length; j++){ - deck.push(values[j] + "-" + types[i]); - } - } -} - -function shuffleDeck(){ - for(let i=0; i