diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..00352331 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +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: + - GSSoC24 + - 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/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/Contributor.md) of this project. + required: true diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md deleted file mode 100644 index 80a27672..00000000 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Documentation Issue -about: Report an issue with the project documentation -title: "[Documentation] :" -labels: Easy, IWOC2024 -assignees: '' - ---- - -## About Documentation - -## Description - -## Affected Documentation Section - -## Expected Documentation - -## Severity -- [ ] Low -- [ ] Medium -- [ ] High -- [ ] Critical - - -## Connect Us On social media - -- [ ] Star the repositry -- [ ] GitHub -- [ ] LinkedIn -- [ ] YouTube -- [ ] Discord - -### Thank you for raising issue in GameSpher 3.0 diff --git a/.github/ISSUE_TEMPLATE/documentation_bug.yml b/.github/ISSUE_TEMPLATE/documentation_bug.yml new file mode 100644 index 00000000..68d7f99e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_bug.yml @@ -0,0 +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: + - GSSoC24 + - 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/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/Contributor.md) of this project. + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 0f623f67..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Feature Request -about: Suggest a new feature or enhancement for the project -title: "[Feature Request] :" -labels: IWOC2024, Medium -assignees: '' - ---- - -## About Feature - -## Description - -## Technologies Used - -## Screenshot - -## Connect Us On Social Media - -- [ ] Star the repositry -- [ ] GitHub -- [ ] LinkedIn -- [ ] YouTube -- [ ] Discord - -### Thank you for raising issue in GameSpher 3.0 diff --git a/.github/ISSUE_TEMPLATE/game_enhancement.yml b/.github/ISSUE_TEMPLATE/game_enhancement.yml new file mode 100644 index 00000000..5fe60c61 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/game_enhancement.yml @@ -0,0 +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: Do you want to have the enhancement of existing game ? ๐Ÿ˜€ Describe yourself.. + 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: + - GSSoC24 + - 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/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/Contributor.md) of this project. + required: true diff --git a/.github/ISSUE_TEMPLATE/new-game.md b/.github/ISSUE_TEMPLATE/new-game.md deleted file mode 100644 index 4d94e901..00000000 --- a/.github/ISSUE_TEMPLATE/new-game.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: New Game -about: Description of game -title: "[Game]: " -labels: IWOC2024, Medium -assignees: '' - ---- - -## Game Name - -## Description - - - -## Screenshot Section - - - -## Demo Video Section - - - -### Connect Us On Social Media - -- [ ] Star the repositry -- [ ] GitHub -- [ ] LinkedIn -- [ ] YouTube -- [ ] Discord - -### Thank you for raising issue in GameSpher 3.0 diff --git a/.github/ISSUE_TEMPLATE/new_game_request.yml b/.github/ISSUE_TEMPLATE/new_game_request.yml new file mode 100644 index 00000000..4007cedd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new_game_request.yml @@ -0,0 +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: + - GSSoC24 + - 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/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/Contributor.md) of this project. + required: true diff --git a/.github/ISSUE_TEMPLATE/question_and_support.yml b/.github/ISSUE_TEMPLATE/question_and_support.yml new file mode 100644 index 00000000..7fdbebd5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question_and_support.yml @@ -0,0 +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: + - GSSoC24 + - 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/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I follow [CONTRIBUTING GUIDELINE](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/Contributor.md) of this project. + required: true diff --git a/.github/ISSUE_TEMPLATE/styles.yml b/.github/ISSUE_TEMPLATE/styles.yml deleted file mode 100644 index f857de7e..00000000 --- a/.github/ISSUE_TEMPLATE/styles.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Style Changing Request -description: Suggest a style designs -title: '[style]: ' -labels: ['enhancement'] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this template! - - type: textarea - id: style-idea - attributes: - label: What's the style idea? - placeholder: Add descriptions - value: 'We need to improve ' - validations: - required: true - - type: textarea - id: screenshots - attributes: - label: Add screenshots - required: true - - - label: I have read the [Contributing Guidelines](https://github.com/priyankarpal/ProjectsHut/blob/main/contributing.md) - required: true - - - label: I agree to follow this project's [Code of Conduct](https://github.com/priyankarpal/ProjectsHut/blob/main/CODE_OF_CONDUCT.md) - required: true - - - label: I'm a GSSoC'23 contributor - - - label: I want to work on this issue - description: Add screenshots to see the demo - placeholder: Add screenshots - value: 'Add screenshots' - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our Code of Conduct - options: - - label: I agree to follow this project's Code of Conduct - required: true - - - label: I have read the [Contributing Guidelines](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/Contributor.md) - required: true - - - label: I agree to follow this project's [Code of Conduct](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) - required: true - - - label: I'm a GSSoC'23 contributor - - - label: I want to work on this issue diff --git a/.github/workflows/AutoGreeting.yml b/.github/workflows/AutoGreeting.yml new file mode 100644 index 00000000..a06bdd22 --- /dev/null +++ b/.github/workflows/AutoGreeting.yml @@ -0,0 +1,25 @@ +name: Auto Greeting + +on: + issues: + types: [opened] + +permissions: + issues: write + +jobs: + greet: + runs-on: ubuntu-latest + steps: + - name: Add a greeting comment + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issueComment = `Hey @${context.payload.issue.user.login}! ๐Ÿ‘‹ \n\n ๐Ÿ‘‰ Thanks for opening this issue. We appreciate your contribution and will look into it as soon as possible. \n ๐Ÿ‘‰ Donโ€™t forget to star our [GameSphere](https://github.com/GameSphere-MultiPlayer/GameSphere) and Follow Us on GitHub \n ๐Ÿ‘‰ Make sure you join our [Discord](https://discord.gg/rZb46cCMmK), we have created separate channels for all projects`; + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: issueComment + }); diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml new file mode 100644 index 00000000..e5e3ad05 --- /dev/null +++ b/.github/workflows/assign.yml @@ -0,0 +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}.`); diff --git a/.github/workflows/auto-label-issues.yml b/.github/workflows/auto-label-issues.yml new file mode 100644 index 00000000..65dbc277 --- /dev/null +++ b/.github/workflows/auto-label-issues.yml @@ -0,0 +1,22 @@ +name: Auto-label on Any Issue + +on: + issues: + types: [opened] + +jobs: + auto-label: + runs-on: ubuntu-latest + steps: + - name: Add labels to any new issue + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labelsToAdd = ["gssoc"]; + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: labelsToAdd + }); diff --git a/.github/workflows/close_invalid_issue.yml b/.github/workflows/close_invalid_issue.yml new file mode 100644 index 00000000..7d94945c --- /dev/null +++ b/.github/workflows/close_invalid_issue.yml @@ -0,0 +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/rZb46cCMmK) .`; + + // 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/close_old_issues.yml b/.github/workflows/close_old_issues.yml new file mode 100644 index 00000000..a8ad6798 --- /dev/null +++ b/.github/workflows/close_old_issues.yml @@ -0,0 +1,80 @@ +name: Close Older Issues + +on: + workflow_dispatch: + +jobs: + close-older-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 @actions/github + + - name: Fetch opened issues + id: fetch_issues + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const oneWeekAgo = new Date(); + oneWeekAgo.setDate(oneWeekAgo.getDate() - 7); + + const { data: issues } = await github.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + sort: 'created', + direction: 'asc', + per_page: 100 + }); + + const olderIssues = issues.filter(issue => issue.pull_request === undefined && new Date(issue.created_at) < oneWeekAgo); + core.setOutput('older_issues', olderIssues.map(issue => issue.number).join(',')); + + - name: Close older issues and comment + if: steps.fetch_issues.outputs.older_issues != '' + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const olderIssueNumbers = '${{ steps.fetch_issues.outputs.older_issues }}'.split(','); + + for (const issueNumber of olderIssueNumbers) { + // Get the issue details + const { data: issue } = await github.issues.get({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: parseInt(issueNumber) + }); + + // Close the older issue + await github.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: parseInt(issueNumber), + state: 'closed' + }); + + // Comment on the closed issue + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: parseInt(issueNumber), + body: `Hello @${issue.user.login}, Time's up!โฐ \n Sorry for closing your issue! \n But it's more than a week since we haven't received anything from your side ๐Ÿ˜ข . \n Come up with new ideas, create a new issue and make sure you finish it within a week! ๐Ÿ”ฅ \n All the best! ๐Ÿš€ \n Happy Hacking! ๐Ÿ’—` + }); + + console.log(`Closed and commented on issue #${issueNumber}.`); + } + + - name: Skip if no older issues + if: steps.fetch_issues.outputs.older_issues == '' + run: echo "No older issues found. Skipping..." diff --git a/.github/workflows/greet.yml b/.github/workflows/greet.yml new file mode 100644 index 00000000..4c70220f --- /dev/null +++ b/.github/workflows/greet.yml @@ -0,0 +1,125 @@ +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/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) `; + 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 "GSSoC24" + id: check_label_gs_soc24 + run: | + if grep -qE "GSSoC24" <<< "${{ github.event.issue.body }}"; then + echo "::set-output name=add_label_gs_soc24::true" + else + echo "::set-output name=add_label_gs_soc24::false" + fi + + - name: Add label "GSSoC24" + if: ${{ steps.check_label_gs_soc24.outputs.add_label_gs_soc24 == '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: ["gssoc"] + }); + + - name: Add label if issue body contains "GSSoC23" + id: check_label_gs_soc23 + run: | + if grep -qE "GSSoC23" <<< "${{ github.event.issue.body }}"; then + echo "::set-output name=add_label_gs_soc23::true" + else + echo "::set-output name=add_label_gs_soc23::false" + fi + + - name: Add label "GSSoC23" + if: ${{ steps.check_label_gs_soc23.outputs.add_label_gs_soc23 == '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: Add label if issue body contains "hacktoberfest" + id: check_label_hacktoberfest + run: | + if grep -qE "hacktoberfest" <<< "${{ github.event.issue.body }}"; then + echo "::set-output name=add_label_hacktoberfest::true" + else + echo "::set-output name=add_label_hacktoberfest::false" + fi + + - name: Add label "hacktoberfest" + if: ${{ steps.check_label_hacktoberfest.outputs.add_label_hacktoberfest == '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: ["hacktoberfest"] + }); + + - name: Add label if issue body contains "IWOC2024" + id: check_label_iwoc + run: | + if grep -qE "IWOC2024" <<< "${{ github.event.issue.body }}"; then + echo "::set-output name=add_label_iwoc::true" + else + echo "::set-output name=add_label_iwoc::false" + fi + + - name: Add label "IWOC2024" + if: ${{ steps.check_label_iwoc.outputs.add_label_iwoc == '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: ["IWOC2024"] + }); diff --git a/.github/workflows/issue_close_greet.yml b/.github/workflows/issue_close_greet.yml new file mode 100644 index 00000000..9489218e --- /dev/null +++ b/.github/workflows/issue_close_greet.yml @@ -0,0 +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}.`); diff --git a/.github/workflows/level_tags.yml b/.github/workflows/level_tags.yml new file mode 100644 index 00000000..95ed1971 --- /dev/null +++ b/.github/workflows/level_tags.yml @@ -0,0 +1,55 @@ +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 (title && title.toLowerCase().includes('documentation bug')) { + tagsToAdd.push('Documentation Bug ๐Ÿ›'); + tagsToAdd.push('level1'); + } + + // Check if issue title contains "Enhancement" + if (title && title.toLowerCase().includes('enhancement')) { + tagsToAdd.push('Enhancement โšก๏ธ'); + tagsToAdd.push('level2'); + } + + 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 new file mode 100644 index 00000000..8a95d1b4 --- /dev/null +++ b/.github/workflows/new_game.yml @@ -0,0 +1,45 @@ +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 ๐ŸŽฎ'; + const level_label='level3'; + await github.issues.addLabels({ owner, repo, issue_number: number, labels: [label,level_label] }); + console.log(`Added label "${label}" to the issue.`); diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml new file mode 100644 index 00000000..132ef733 --- /dev/null +++ b/.github/workflows/pr_check.yml @@ -0,0 +1,216 @@ +name: Pull Request Validation + +on: + pull_request_target: + types: + - opened + - synchronize + +jobs: + pr-validation: + 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 octokit + + - name: Validate pull request + id: validate_pr + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const prNumber = context.payload.pull_request.number; + const repoOwner = context.payload.repository.owner.login; + const repoName = context.payload.repository.name; + + const { data: pr } = await github.pulls.get({ + owner: repoOwner, + repo: repoName, + pull_number: prNumber + }); + + // Check if the PR content contains an issue reference + const hasIssueReference = /#[0-9]+/.test(pr.body); + if (!hasIssueReference) { + // Close the PR + await github.pulls.update({ + owner: repoOwner, + repo: repoName, + pull_number: prNumber, + state: 'closed' + }); + + // Comment on the closed PR + await github.issues.createComment({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + body: `Hey @${pr.user.login},\nPlease make sure to link the relevant issue using the appropriate syntax, such as "#issueNumber" ๐Ÿ‘€. \n Follow the proper guideline and make a new PR again ๐Ÿ˜€. \n Happy Hacking ๐Ÿ’—` + }); + + console.log(`Closed and commented on pull request #${prNumber} due to missing issue reference.`); + return; // Stop further processing + } + + // Get the issue number from the PR content + const issueNumber = pr.body.match(/#([0-9]+)/)[1]; + + // Get the issue details + const { data: issue } = await github.issues.get({ + owner: repoOwner, + repo: repoName, + issue_number: issueNumber + }); + + // Check if the issue is open + if (issue.state !== 'open') { + // Close the PR + await github.pulls.update({ + owner: repoOwner, + repo: repoName, + pull_number: prNumber, + state: 'closed' + }); + + // Comment on the closed PR + await github.issues.createComment({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + body: `Hey @${pr.user.login},\n You can't work on a closed issue ๐Ÿ‘€! \n Follow the proper guideline and make a new PR again ๐Ÿ˜€. \n Happy Hacking ๐Ÿ’—` + }); + + console.log(`Closed and commented on pull request #${prNumber} due to closed issue reference.`); + return; // Stop further processing + } + + // Check if the issue has the "level3" label + const hasLevel3Label = issue.labels.some(label => label.name.toLowerCase() === 'level3'); + if (hasLevel3Label) { + // Get the PR files + const { data: files } = await github.pulls.listFiles({ + owner: repoOwner, + repo: repoName, + pull_number: prNumber + }); + + // Check for required changes in the PR + const changes = []; + + // Check if a new folder is created inside the "Games" folder and contains a new file + const gamesFolderPath = 'Games/'; + const newFolderRegex = new RegExp(`${gamesFolderPath}([^/]+)/.*$`); + const newFolderCreated = files.some(file => newFolderRegex.test(file.filename)); + + // Check if a README.md file is added in the newly created folder + const readmeRegex = new RegExp(`${gamesFolderPath}([^/]+)/README.md$`); + const readmeAdded = files.some(file => readmeRegex.test(file.filename)); + + // Comment with the required changes, if any + if (!newFolderCreated) { + changes.push('- Please create a new folder inside the "Games" folder.'); + } + if (!readmeAdded) { + changes.push('- Please add a README.md file inside the newly created folder.'); + } + + // Check if the main README.md file is modified + const mainReadmeModified = files.some(file => file.filename === 'README.md'); + + if (!mainReadmeModified) { + changes.push('- Please modify the main README.md file.'); + } + + // Check if an image is added to the assets/images directory + const imageAdded = files.some(file => file.filename.startsWith('assets/images/')); + + if (!imageAdded) { + changes.push('- Please add an image to the assets/images directory.'); + } + + if (changes.length > 0) { + const comment = [ + `Hello @${pr.user.login},`, + `You need to make the following changes:`, + ...changes.map(change => ` ${change}`), + '', + 'Hoping that you will make those changes soon ๐Ÿš€' + ].join('\n'); + + // Comment on the pull request + await github.pulls.createReview({ + owner: repoOwner, + repo: repoName, + pull_number: prNumber, + event: 'REQUEST_CHANGES', + body: comment + }); + + // Add labels to the pull request + await github.issues.addLabels({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + labels: ['Changes Requested โš’๏ธ', 'Pending โฑ๏ธ'] + }); + + console.log(`Commented on pull request #${prNumber} with required changes.`); + } else { + const existingLabels = pr.labels.map(label => label.name.toLowerCase()); + + if (existingLabels.includes('changes requested') || existingLabels.includes('pending')) { + // Remove the "changes requested" and "pending" labels + await github.issues.removeLabel({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + name: 'Changes Requested โš’๏ธ' + }); + await github.issues.removeLabel({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + name: 'Pending โฑ๏ธ' + }); + + // Approve the changes + await github.pulls.createReview({ + owner: repoOwner, + repo: repoName, + pull_number: prNumber, + event: 'APPROVE' + }); + + // Add the "under review" label + await github.issues.addLabels({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + labels: ['Pending โฑ๏ธ'] + }); + + console.log(`Updated pull request #${prNumber} with approved changes.`); + } else { + // Add label to the pull request + await github.issues.addLabels({ + owner: repoOwner, + repo: repoName, + issue_number: prNumber, + labels: ['Pending โฑ๏ธ'] + }); + + console.log(`Pull request #${prNumber} is valid and meets the requirements.`); + } + } + } else { + console.log(`Pull request #${prNumber} does not have the "level3" label. No further validation is performed.`); + } diff --git a/.github/workflows/pr_close_greet.yml b/.github/workflows/pr_close_greet.yml new file mode 100644 index 00000000..814e727c --- /dev/null +++ b/.github/workflows/pr_close_greet.yml @@ -0,0 +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}.`); diff --git a/.github/workflows/pr_greet.yml b/.github/workflows/pr_greet.yml new file mode 100644 index 00000000..eda9dc1a --- /dev/null +++ b/.github/workflows/pr_greet.yml @@ -0,0 +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}.`); diff --git a/.github/workflows/prevent_multiple_issues.yml b/.github/workflows/prevent_multiple_issues.yml new file mode 100644 index 00000000..1d3ca634 --- /dev/null +++ b/.github/workflows/prevent_multiple_issues.yml @@ -0,0 +1,77 @@ +name: Close Issue if Opener has Opened Issues + +on: + issues: + types: + - opened + +jobs: + close_issue: + runs-on: ubuntu-latest + + steps: + - name: Check if opener has multiple open issues + id: check_open_issues + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const issueNumber = context.issue.number; + const issueOpener = context.payload.issue.user.login; + + const previousIssuesResponse = await github.request('GET /repos/{owner}/{repo}/issues', { + owner, + repo, + state: 'open', + creator: issueOpener + }); + + const previousOpenIssues = previousIssuesResponse.data.filter(issue => issue.number !== issueNumber && !issue.pull_request); + const previousOpenIssueNumbers = previousOpenIssues.map(issue => `#${issue.number}`); + const openerName = context.payload.issue.user.login; + + const closeIssue = previousOpenIssues.length > 0; + console.log(`Close issue: ${closeIssue}`); + + if (closeIssue) { + const comment = `Hey @${openerName} , You can't have another issue before completing the previous one ๐Ÿ˜€ \n you already have the following ${previousOpenIssues.length} open issues ๐Ÿ‘€ ! :\n\n${previousOpenIssueNumbers.join('\n')}`; + core.exportVariable('comment_body', comment); // Export the variable + core.setOutput('close_issue', true); + } else { + core.exportVariable('comment_body', ''); + core.setOutput('close_issue', false); + } + + - name: Close the issue and add a comment + if: always() && ${{ needs.check_open_issues.outputs.close_issue }} + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const issueNumber = context.issue.number; + const comment = process.env.comment_body; // Retrieve the exported variable + + if (comment.trim() === '') { + console.log('Comment body is empty. Skipping comment creation.'); + return; + } + + const closeComment = `${comment}`; + + await github.issues.createComment({ + owner, + repo, + issue_number: issueNumber, + body: closeComment + }); + + await github.issues.update({ + owner, + repo, + issue_number: issueNumber, + state: 'closed' + }); diff --git a/.github/workflows/prevent_multiple_pr.yml b/.github/workflows/prevent_multiple_pr.yml new file mode 100644 index 00000000..65e542a4 --- /dev/null +++ b/.github/workflows/prevent_multiple_pr.yml @@ -0,0 +1,77 @@ +name: Close Issue if Opener has Opened Pull Requests + +on: + pull_request_target: + types: + - opened + +jobs: + close_pull_request: + runs-on: ubuntu-latest + + steps: + - name: Check if opener has multiple open pull requests + id: check_open_pull_requests + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const pullRequestNumber = context.payload.pull_request.number; + const pullRequestOpener = context.payload.pull_request.user.login; + + const previousPullRequestsResponse = await github.pulls.list({ + owner, + repo, + state: 'open' + }); + + const previousOpenPullRequests = previousPullRequestsResponse.data.filter(pr => pr.user.login === pullRequestOpener && pr.number !== pullRequestNumber); + const previousOpenPullRequestNumbers = previousOpenPullRequests.map(pr => `#${pr.number}`); + const openerName = context.payload.pull_request.user.login; + + const closePullRequest = previousOpenPullRequests.length > 0; + console.log(`Close pull request: ${closePullRequest}`); + + if (closePullRequest) { + const comment = `Hey @${openerName}, you can't open another pull request before completing the previous one ๐Ÿ˜€\nYou already have the following ${previousOpenPullRequests.length} open pull request(s):\n${previousOpenPullRequestNumbers.join('\n')}`; + core.exportVariable('comment_body', comment); + core.setOutput('close_pull_request', true); + } else { + core.exportVariable('comment_body', ''); + core.setOutput('close_pull_request', false); + return; // Return and skip further steps + } + + - name: Close the pull request and add a comment + if: always() && ${{ needs.check_open_pull_requests.outputs.close_pull_request }} + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const pullRequestNumber = context.payload.pull_request.number; + const comment = process.env.comment_body; + + if (comment.trim() === '') { + console.log('Comment body is empty. Skipping comment creation.'); + return; + } + + const closeComment = `${comment}`; + + await github.issues.createComment({ + owner, + repo, + issue_number: pullRequestNumber, + body: closeComment + }); + + await github.pulls.update({ + owner, + repo, + pull_number: pullRequestNumber, + state: 'closed' + }); diff --git a/.github/workflows/remove_duplicate.yml b/.github/workflows/remove_duplicate.yml new file mode 100644 index 00000000..a0947dfb --- /dev/null +++ b/.github/workflows/remove_duplicate.yml @@ -0,0 +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..." diff --git a/MultiPlayer - Games/Pop_My_Balloon/BalloonAnimation.css b/MultiPlayer - Games/Pop_My_Balloon/BalloonAnimation.css new file mode 100644 index 00000000..b21c6c97 --- /dev/null +++ b/MultiPlayer - Games/Pop_My_Balloon/BalloonAnimation.css @@ -0,0 +1,212 @@ + + + + +body{ + font-family: 'Wendy One', sans-serif; +} + +span { + text-transform: uppercase; +} +.container { + width: 800px; + height: 420px; + padding: 10px; + margin: 0 auto; + background: whitesmoke; + position: relative; +} +.balloon { + width: 738px; + margin: 0 auto; + padding-top: 30px; + position: relative; +} +.balloon > div { + width:104px; + height:140px; + background:rgba(182, 15, 97, 0.9); + border-radius: 0; + border-radius:80% 80% 80% 80%; + margin: 0 auto; + position: absolute; + padding:10px; + box-shadow:inset 17px 7px 10px rgba(182, 15, 97, 0.9); + -webkit-transform-origin: bottom center; +} +.balloon > div:nth-child(1){ + background: rgba(182, 15, 97, 0.9); + left: 0; + box-shadow:inset 10px 10px 10px darken(rgba(182, 15, 97, 0.9), 10%); + -webkit-animation:balloon1 6s ease-in-out infinite; + -moz-animation:balloon1 6s ease-in-out infinite; + -o-animation:balloon1 6s ease-in-out infinite; + animation:balloon1 6s ease-in-out infinite; + &:before { + color: rgba(182, 15, 97, 0.9); ; + } + +} +.balloon > div:nth-child(2){ + background: rgba(242, 112, 45, 0.9); + left: 120px; + box-shadow:inset 10px 10px 10px darken(rgba(242, 112, 45, 0.9), 10%); + -webkit-animation:balloon2 6s ease-in-out infinite; + -moz-animation:balloon2 6s ease-in-out infinite; + -o-animation:balloon2 6s ease-in-out infinite; + animation:balloon2 6s ease-in-out infinite; + &:before { + color: rgba(242, 112, 45, 0.9) ; + } + +} +.balloon > div:nth-child(3){ + background: rgba(45, 181, 167, 0.9);; + left: 240px; + box-shadow:inset 10px 10px 10px darken(rgba(45, 181, 167, 0.9), 10%); + -webkit-animation:balloon4 6s ease-in-out infinite; + -moz-animation:balloon4 6s ease-in-out infinite; + -o-animation:balloon4 6s ease-in-out infinite; + animation:balloon4 6s ease-in-out infinite; + &:before { + color: rgba(45, 181, 167, 0.9); + } + +} +.balloon > div:nth-child(4){ + background: rgba(190, 61, 244, 0.9); + left: 360px; + box-shadow:inset 10px 10px 10px darken(rgba(190, 61, 244, 0.9), 10%); + -webkit-animation:balloon1 5s ease-in-out infinite; + -moz-animation:balloon1 5s ease-in-out infinite; + -o-animation:balloon1 5s ease-in-out infinite; + animation:balloon1 5s ease-in-out infinite; + &:before { + color: rgba(190, 61, 244, 0.9); + } + +} +.balloon > div:nth-child(5){ + background: rgba(180, 224, 67, 0.9); + left: 480px; + box-shadow:inset 10px 10px 10px darken(rgba(180, 224, 67, 0.9), 10%); + -webkit-animation:balloon3 5s ease-in-out infinite; + -moz-animation:balloon3 5s ease-in-out infinite; + -o-animation:balloon3 5s ease-in-out infinite; + animation:balloon3 5s ease-in-out infinite; + &:before { + color: rgba(180, 224, 67, 0.9); + } + +} +.balloon > div:nth-child(6){ + background: rgba(242, 194, 58, 0.9); + left: 600px; + box-shadow:inset 10px 10px 10px darken(rgba(242, 194, 58, 0.9), 10%); + -webkit-animation:balloon2 3s ease-in-out infinite; + -moz-animation:balloon2 3s ease-in-out infinite; + -o-animation:balloon2 3s ease-in-out infinite; + animation:balloon2 3s ease-in-out infinite; + &:before { + color: rgba(242, 194, 58, 0.9) ; + } + +} +.balloon > div:before { + color:rgba(182, 15, 97, 0.9); + position:absolute; + bottom:-11px; + left: 52px; + content:"โ–ฒ"; + font-size:1em; +} + +span { + font-size: 4.8em; + color: white; + position: relative; + top: 30px; + left: 50%; + margin-left: -27px; +} + +/*BALLOON 1 4*/ +@-webkit-keyframes balloon1 { + 0%,100%{ -webkit-transform:translateY(0) rotate(-6deg);} + 50%{ -webkit-transform:translateY(-20px) rotate(8deg); } +} +@-moz-keyframes balloon1 { + 0%,100%{ -moz-transform:translateY(0) rotate(-6deg);} + 50%{ -moz-transform:translateY(-20px) rotate(8deg); } +} +@-o-keyframes balloon1 { + 0%,100%{ -o-transform:translateY(0) rotate(-6deg);} + 50%{ -o-transform:translateY(-20px) rotate(8deg); } +} +@keyframes balloon1 { + 0%,100%{ transform:translateY(0) rotate(-6deg);} + 50%{ transform:translateY(-20px) rotate(8deg); } +} + +/* BAllOON 2 5*/ +@-webkit-keyframes balloon2 { + 0%,100%{ -webkit-transform:translateY(0) rotate(6eg);} + 50%{ -webkit-transform:translateY(-30px) rotate(-8deg); } +} +@-moz-keyframes balloon2 { + 0%,100%{ -moz-transform:translateY(0) rotate(6deg);} + 50%{ -moz-transform:translateY(-30px) rotate(-8deg); } +} +@-o-keyframes balloon2 { + 0%,100%{ -o-transform:translateY(0) rotate(6deg);} + 50%{ -o-transform:translateY(-30px) rotate(-8deg); } +} +@keyframes balloon2 { + 0%,100%{ transform:translateY(0) rotate(6deg);} + 50%{ transform:translateY(-30px) rotate(-8deg); } +} + + +/* BAllOON 0*/ +@-webkit-keyframes balloon3 { + 0%,100%{ -webkit-transform:translate(0, -10px) rotate(6eg);} + 50%{ -webkit-transform:translate(-20px, 30px) rotate(-8deg); } +} +@-moz-keyframes balloon3 { + 0%,100%{ -moz-transform:translate(0, -10px) rotate(6eg);} + 50%{ -moz-transform:translate(-20px, 30px) rotate(-8deg); } +} +@-o-keyframes balloon3 { + 0%,100%{ -o-transform:translate(0, -10px) rotate(6eg);} + 50%{ -o-transform:translate(-20px, 30px) rotate(-8deg); } +} +@keyframes balloon3 { + 0%,100%{ transform:translate(0, -10px) rotate(6eg);} + 50%{ transform:translate(-20px, 30px) rotate(-8deg); } +} + +/* BAllOON 3*/ +@-webkit-keyframes balloon4 { + 0%,100%{ -webkit-transform:translate(10px, -10px) rotate(-8eg);} + 50%{ -webkit-transform:translate(-15px, 20px) rotate(10deg); } +} +@-moz-keyframes balloon4 { + 0%,100%{ -moz-transform:translate(10px, -10px) rotate(-8eg);} + 50%{ -moz-transform:translate(-15px, 10px) rotate(10deg); } +} +@-o-keyframes balloon4 { + 0%,100%{ -o-transform:translate(10px, -10px) rotate(-8eg);} + 50%{ -o-transform:translate(-15px, 10px) rotate(10deg); } +} +@keyframes balloon4 { + 0%,100%{ transform:translate(10px, -10px) rotate(-8eg);} + 50%{ transform:translate(-15px, 10px) rotate(10deg); } +} +h1 { + position:relative; + top: 200px; + text-align: center; + color: rgba(182, 15, 97, 0.9); + font-size: 3.5em; +} diff --git a/MultiPlayer - Games/Pop_My_Balloon/BalloonText.html b/MultiPlayer - Games/Pop_My_Balloon/BalloonText.html new file mode 100644 index 00000000..11c1c9b9 --- /dev/null +++ b/MultiPlayer - Games/Pop_My_Balloon/BalloonText.html @@ -0,0 +1,12 @@ + +
+
+
P
+
O
+
P
+
P
+
O
+
P
+
+

+
diff --git a/MultiPlayer - Games/Pop_My_Balloon/README.md b/MultiPlayer - Games/Pop_My_Balloon/README.md new file mode 100644 index 00000000..1c37a1f8 --- /dev/null +++ b/MultiPlayer - Games/Pop_My_Balloon/README.md @@ -0,0 +1,44 @@ +# Pop My Balloon + +--- + +
+ +## **Description ๐Ÿ“ƒ** +- It is a multiplayer game. +- The basic premise of the game remains the same, regardless of the difficulty level or the input method. There will be a range of numbers from which players can choose a number. If the manage to guess the randomly chosen number, the balloon will pop and they lose. If they manage to avoid the lucky number, the range decreases such that their guess either becomes the new lower bound or new upper bound, and the balloon inflates just a little bit more. + + +
+ +## **Functionalities ๐ŸŽฎ** +- It is a multiplayer game. +- We have two levels: + +Easy Level: The range starts off as 0-100 and players can guess any number within the range. +Harder Level: The range starts off as 0-84, and players can only guess numbers that are either from the lower bound (LB) to LB+12 or from the upper bound (UB) to UB-12. + +- We also have two different modes: + +Text Mode: Players type their guesses manually into the guess box. +Speech Mode: Players can say their guesses and the game will try to recognize and process what they guess. + +
+ +## **How to play? ๐Ÿ•น๏ธ** + +- Player 1 has to guess any number and that has to avoid the lucky number. +- Player 2 has to do the same as Player 1. +- The goal is to complete the game without guessing the lucky number. +- Each time you guess correct the balloon blows up. +- Keep playing and try to not to guess the lucky number in order to win the game. + +
+ +## **Screenshots ๐Ÿ“ธ** + +![Screenshot](../../assets/images/Pop_My_Balloon.png) + +
+ + diff --git a/MultiPlayer - Games/Pop_My_Balloon/index.html b/MultiPlayer - Games/Pop_My_Balloon/index.html new file mode 100644 index 00000000..bc47faa7 --- /dev/null +++ b/MultiPlayer - Games/Pop_My_Balloon/index.html @@ -0,0 +1,169 @@ + + + + + + Let's Blow๐ŸŽˆ + + + + + + + + + + + + + + + + + + + + + +
+

Let's Blow๐ŸŽˆ

+ + + +
+ + +
+

Settings

+

Pick a level

+ + +

Use a mike!

+ + + + +
+ + +
+

What am I doing?

+

+ Welcome to The Blows, the game where you DON'T want to guess the lucky number! + We have two different levels for you, and Easy Level and a Harder Level. In both levels, + a random number will be chosen, and you and your friends try to not guess the number. The range of numbers + you can guess gets smaller every turn (the lowest and highest numbers you can guess are at the top of the screen), + and when that poor, unfortunate soul guesses the number the balloon pops! +

+

Easy Level

+

+ In the Easy Level, all the players can guess any number, as long as they are between the lowest and highest number. + The starting range of numbers is 1 to 100. +

+

Harder Level

+

+ In the Harder Level, you can only guess numbers that are between the lowest number and 12 plus the lowest number, or numbers + that are between the highest number and the highest number minus 12. The starting range of numbers is 1 to 84. +

+ + +
+ + +
+
+

+ Lowest: 0 + Easy + Highest: 100 +

+ +
+
+
+ +

+ +
+
+

What's your guess Player X

+ + + +
+ +
+

Are you ready Player X?

+

+ + + +
+ + + +
+ +
+ + +
+
+ +
+

How many people are playing?

+ + + +
+ +
+ + + + \ No newline at end of file diff --git a/MultiPlayer - Games/Pop_My_Balloon/script.js b/MultiPlayer - Games/Pop_My_Balloon/script.js new file mode 100644 index 00000000..0407023f --- /dev/null +++ b/MultiPlayer - Games/Pop_My_Balloon/script.js @@ -0,0 +1,475 @@ +totalNumPlayers = 1; +isEasy = true; +isHard = false; +isText = true; +isSpeech = false; + +function toggle(id1, id2) { + let x = document.getElementById(id1); + let y = document.getElementById(id2); + + x.style.display = 'block'; + y.style.display = 'none'; +} + +LB = 0; +UB = 100; +currentGuess = 0; +pop = 0; +bWidth = 120; +bHeight = 145; +sTop = 153; +sHeight = 120; + +// some transitions +$(document).ready(function () { + $("#startGame").click(function () { + $("#title").fadeOut(800); + setTimeout(function () { + resetGame(); + toggle("setup", "actualGame"); + $("#game").fadeIn(1000); + }, 1000); + + }); + + $("#showHelp").click(function () { + $("#title").fadeOut(800); + setTimeout(function () { + $("#help").fadeIn(1000); + }, 1000); + }); + + $("#gameToTitle").click(function () { + $("#game").fadeOut(800); + setTimeout(function () { + $("#title").fadeIn(1000); + }, 1000); + }); + + $("#helpToTitle").click(function () { + $("#help").fadeOut(800); + setTimeout(function () { + $("#title").fadeIn(1000); + }, 1000); + }); + + $("#helpToGame").click(function () { + resetGame(); + toggle("setup", "actualGame"); + $("#help").fadeOut(800); + setTimeout(function () { + $("#game").fadeIn(1000); + }, 1000); + }); + + $("#endGame").click(function () { + $("#game").fadeOut(800); + setTimeout(function () { + $("#title").fadeIn(1000); + }, 1000); + }); + + $("#returnToMenu").click(function () { + $("#game").fadeOut(800); + setTimeout(function () { + $("#title").fadeIn(1000); + }, 1000); + }); + + $("#playAgain").click(function () { + $("#actualGame").fadeOut(800); + setTimeout(function () { + resetGame(); + $("#setup").fadeIn(1000); + }, 1000); + }); + + $('#showSettings').click(function () { + $("#title").fadeOut(800); + setTimeout(function () { + $("#settings").fadeIn(1000); + }, 1000); + }); + + //choosing settings + $('#pickEasy').click(function () { + $('#pickEasy').css('background', 'hsl(215,50%,65%)'); + $('#pickHarder').css('background', '#eee'); + isEasy = true; + isHard = false; + }); + $('#pickHarder').click(function () { + $('#pickHarder').css('background', 'hsl(215,50%,65%)'); + $('#pickEasy').css('background', '#eee'); + isEasy = false; + isHard = true; + }); + $('#useText').click(function () { + $('#useText').css('background', 'hsl(215,50%,65%)'); + $('#useSpeech').css('background', '#eee'); + isText = true; + isSpeech = false; + }); + $('#useSpeech').click(function () { + $('#useSpeech').css('background', 'hsl(215,50%,65%)'); + $('#useText').css('background', '#eee'); + isSpeech = true; + isText = false; + }); + + $('#settingsToTitle').click(function () { + $("#settings").fadeOut(800); + setTimeout(function () { + $("#title").fadeIn(1000); + }, 1000); + }); + + $("#begin").click(function () { + totalNumPlayers = Number(document.getElementById('numPlayers').value); + + if (totalNumPlayers < 1) { + document.getElementById("askNumPlayers").innerText = "Haha, aren't you soooo funny..."; + setTimeout(function () { + document.getElementById("askNumPlayers").innerText = "How many people are playing?"; + }, 1300); + return; + } + else if (totalNumPlayers > 10) { + document.getElementById("askNumPlayers").innerText = "Hmm, that's too many people... "; + setTimeout(function () { + document.getElementById("askNumPlayers").innerText = "How many people are playing?"; + }, 1300); + return; + } + + if (isText) { + document.getElementById("textGuessing").style.display = 'block'; + document.getElementById('speechGuessing').style.display = 'none'; + } + else { + document.getElementById("textGuessing").style.display = 'none'; + document.getElementById('speechGuessing').style.display = 'block'; + } + + $("#setup").fadeOut(800); + setTimeout(function () { + $("#actualGame").fadeIn(1000); + }, 1000); + + //begin the game + if (isEasy) { + LB = 0; + UB = 100; + pop = Math.floor(Math.random() * 101); + //pop = 1; + } + else { + LB = 0; + UB = 84; + pop = Math.floor(Math.random() * 85); + //pop = 1; + } + popTheBalloon(); + }); + + // speech recognition + var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition + var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList + var SpeechRecognitionEvent = SpeechRecognitionEvent || webkitSpeechRecognitionEvent + + var colors = ['0']; + for (var i = 1; i < 101; i++) { + colors.push(i.toString()); + } + + var grammar = '#JSGF V1.0; grammar colors; public = ' + colors.join(' | ') + ' ;' + + var recognition = new SpeechRecognition(); + var speechRecognitionList = new SpeechGrammarList(); + speechRecognitionList.addFromString(grammar, 1); + recognition.grammars = speechRecognitionList; + //recognition.continuous = false; + recognition.lang = 'en-US'; + recognition.interimResults = false; + recognition.maxAlternatives = 1; + + var bg = document.querySelector('html'); + var hints = document.querySelector('.hints'); + + function popTheBalloon() { + let i = 1; + if (isText) { + document.getElementById("playerCommand").innerText = "What's your guess Player " + i + "?"; + document.getElementById("guess").addEventListener("click", function () { + + $('#guess').prop('disabled', true); + currentGuess = Number(document.getElementById("playerGuess").value); + if (!isGuessValid(currentGuess)) { + $('#guess').prop('disabled', false); + return; + } + else { + document.getElementById("guessErr").style.display = 'none'; + } + + bWidth += 20; + bHeight += 20; + sTop += 20; + sHeight -= 5; + + $("#animateBalloon").animate({ + width: bWidth + 'px', + height: bHeight + 'px' + }, { + duration: 2000, + queue: false, + complete: function () { /* Animation complete */ } + }); + + $(".balloonString").animate({ + top: sTop + 'px', + height: sHeight + 'px' + }, { + duration: 2000, + queue: false, + complete: function () { /* Animation complete */ } + }); + + if (currentGuess === pop) { + setTimeout(function () { + //pop balloon + $('#animateBalloon').hide("explode", { pieces: 16 }, 500); + setTimeout(function () { + document.getElementById("balloon").innerText = "Player " + i + ", you lost!"; + }, 500); + + toggle("gameOver", "guessing"); + $('#guess').prop('disabled', false); + return; + }, 2000); + } + else if (currentGuess < pop) { + setTimeout(function () { + LB = currentGuess; + document.getElementById("lowest").innerText = "Lowest: " + LB; + i++; + $('#guess').prop('disabled', false); + if (i > totalNumPlayers) { + i = 1; + } + document.getElementById("playerCommand").innerText = "What's your guess Player " + i + "?"; + }, 2000); + } + else if (currentGuess > pop) { + setTimeout(function () { + UB = currentGuess; + document.getElementById("highest").innerText = "Highest: " + UB; + i++; + $('#guess').prop('disabled', false); + if (i > totalNumPlayers) { + i = 1; + } + document.getElementById("playerCommand").innerText = "What's your guess Player " + i + "?"; + }, 2000); + } + }); + } + else { + document.getElementById("playerCommand-speech").innerText = "Player " + i + ", are you ready?"; + document.getElementById("ready").addEventListener("click", function () { + document.getElementById("playerCommand-speech").innerText = "What's your guess Player " + i + "?"; + recognition.start(); + console.log('Ready to receive a number.'); + $('#ready').prop('disabled', true); + + recognition.onresult = function (event) { + + var last = event.results.length - 1; + var color = event.results[last][0].transcript; + + console.log('Result received: ' + color + '.'); + if (color === "one") { + color = 1; + } + // bg.style.backgroundColor = color; + var isValidNumber = !isNaN(color); + console.log('Valid: ' + isValidNumber); + console.log('Confidence: ' + event.results[0][0].confidence); + + if (isValidNumber) { + currentGuess = Number(color); + $('#playerGuess-speech').innerText = currentGuess; + + if (!isGuessValid(currentGuess)) { + $('#ready').prop('disabled', false); + return; + } + else { + document.getElementById("guessErr-speech").style.display = 'none'; + } + + bWidth += 20; + bHeight += 20; + sTop += 20; + sHeight -= 5; + + $("#animateBalloon").animate({ + width: bWidth + 'px', + height: bHeight + 'px' + }, { + duration: 2000, + queue: false, + complete: function () { /* Animation complete */ } + }); + + $(".balloonString").animate({ + top: sTop + 'px', + height: sHeight + 'px' + }, { + duration: 2000, + queue: false, + complete: function () { /* Animation complete */ } + }); + + if (currentGuess === pop) { + setTimeout(function () { + //pop balloon + $('#animateBalloon').hide("explode", { pieces: 16 }, 500); + setTimeout(function () { + document.getElementById("balloon").innerText = "Player " + i + ", you lost!"; + }, 500); + + toggle("gameOver", "guessing"); + $('#ready').prop('disabled', false); + return; + }, 2000); + } + else if (currentGuess < pop) { + setTimeout(function () { + LB = currentGuess; + document.getElementById("lowest").innerText = "Lowest: " + LB; + i++; + $('#ready').prop('disabled', false); + if (i > totalNumPlayers) { + i = 1; + } + document.getElementById("playerCommand-speech").innerText = "Player " + i + ", are you ready?"; + }, 2000); + } + else if (currentGuess > pop) { + setTimeout(function () { + UB = currentGuess; + document.getElementById("highest").innerText = "Highest: " + UB; + i++; + $('#ready').prop('disabled', false); + if (i > totalNumPlayers) { + i = 1; + } + document.getElementById("playerCommand").innerText = "Player " + i + ", are you ready?"; + }, 2000); + } + } + } + + recognition.onspeechend = function () { + $('#ready').prop('disabled', false); + recognition.stop(); + } + + recognition.onnomatch = function (event) { + console.log("I didn't recognise that number."); + $('playerGuess-speech').innerText = "Sorry, we couldn't understand your guess."; + $('speechErr').style.display = 'block'; + } + + recognition.onerror = function (event) { + console.log('Error occurred in recognition: ' + event.error); + $('playerGuess-speech').innerText = "Sorry, we couldn't understand your guess."; + $('speechErr').style.display = 'block'; + } + + }); + } + + } + + function isGuessValid(guess) { + if (currentGuess > UB || currentGuess < LB) { + if (isText) + { + document.getElementById("guessErr").style.display = 'block'; + } + else + { + document.getElementById("guessErr-speech").style.display = 'block'; + } + return false; + } + + if (isHard) { + if (currentGuess > LB + 12 && currentGuess < UB - 12) { + if(isText) + { + document.getElementById("guessErr").style.display = 'block'; + } + else + { + document.getElementById("guessErr-speech").style.display = 'block'; + } + return false; + } + } + return true; + } + + function resetGame() { + toggle("guessing", "gameOver"); + totalNumPlayers = 1; + document.getElementById("numPlayers").value = 1; + + LB = 0; + UB = 100; + currentGuess = 0; + document.getElementById("playerGuess").value = 0; + pop = 0; + bWidth = 120; + bHeight = 145; + sTop = 153; + sHeight = 120; + + $("#animateBalloon").animate({ + width: '120px', + height: '145px' + }, { + duration: 500, + queue: false, + complete: function () { /* Animation complete */ } + }); + + $(".balloonString").animate({ + top: '153px', + height: '120px' + }, { + duration: 500, + queue: false, + complete: function () { /* Animation complete */ } + }); + + $('#animateBalloon').show(); + + document.getElementById("lowest").innerText = "Lowest: 0"; + + document.getElementById("balloon").innerText = ""; + if (isEasy) { + document.getElementById('level').innerText = "Easy"; + document.getElementById("highest").innerText = "Highest: 100"; + } + else { + document.getElementById('level').innerText = 'Harder'; + document.getElementById("highest").innerText = "Highest: 84"; + } + } +}); + + diff --git a/MultiPlayer - Games/Pop_My_Balloon/styles.css b/MultiPlayer - Games/Pop_My_Balloon/styles.css new file mode 100644 index 00000000..fb657125 --- /dev/null +++ b/MultiPlayer - Games/Pop_My_Balloon/styles.css @@ -0,0 +1,240 @@ +/* +font-family: 'Comfortaa', cursive; +font-family: 'Lora', serif; +*/ + +body +{ + background-color: #2bbad3; +} + +#title +{ + display: block; + position: fixed; + top: 50%; + left: 50%; + margin-top: -50px; + margin-left: -200px; +} + +#game +{ + display: none; +} + +#setup +{ + position: fixed; + top: 50%; + left: 50%; + margin-top: -50px; + margin-left: -225px; +} + +#help +{ + display: none; +} + +#actualGame +{ + display: none; +} + +#guessing +{ + margin-top: 170px; +} + +#gameOver +{ + display: none; + margin-top: 70px; +} + +#guessErr +{ + display: none; +} + +#lowest +{ + font-family: 'Lora', serif; + font-size: 16px; + text-align: left; + margin: 20px; + margin-right: 25%; +} + +#highest +{ + font-family: 'Lora', serif; + font-size: 16px; + text-align: right; + margin: 20px; + margin-left: 25%; +} + +#level +{ + font-family: 'Lora', serif; + font-size: 16px; + text-align: center; +} + +#settings +{ + display: none; +} + +#settingsToTitle +{ + margin-top: 70px; +} + +#pickEasy +{ + background: hsl(215,50%,65%); +} + +#useText +{ + background: hsl(215,50%,65%); +} + +#speechErr +{ + display: none; +} + +#guessErr-speech +{ + display:none; +} + +#speechGuessing +{ + display: none; +} + +div +{ + text-align: center; +} + +h1 +{ + text-align: center; + font-family: 'Comfortaa', cursive; + margin: 15px 0; + margin-bottom: 25px; +} + +h2 +{ + text-align: center; + font-family: 'Comfortaa', cursive; + margin: 15px 0; + margin-top: 50px; +} + +h3 +{ + font-family: 'Lora', serif; + font-size: 16px; + margin-bottom: 20px; +} + +p +{ + font-family: 'Lora', serif; + font-size: 14px; + margin: 30px 20px; +} + +input +{ + border-radius: 10px; + width: 50%; + margin: 10px auto; + padding: 10px; + font-family: 'Lora', serif; + font-variant: bold; + font-size: 16px; +} + +label +{ + font-family: 'Lora', serif; + font-size: 12px; +} + +.btn +{ + font-family: 'Lora', serif; + border-radius: 10px; + width: 50%; + margin: 10px; + padding: 10px; + font-size: 16px; + border: solid black; + color: black; +} + +/* +Balloon animation +*/ +.balloon { + display:inline-block; + width:120px; + height:145px; + background:hsl(316, 96%, 45%); + border-radius:80%; + position:relative; + box-shadow:inset -10px -10px 0 rgba(0,0,0,0.07); + margin:20px 30px; + transition:transform 0.5s ease; + z-index:10; + animation:balloons 4s ease-in-out infinite; + transform-origin:bottom center; +} + +@keyframes balloons { + 0%,100%{ transform:translateY(0) rotate(-4deg); } + 50%{ transform:translateY(-25px) rotate(4deg); } +} + + +.balloon:before { + content:"โ–ฒ"; + font-size:20px; + color:hsl(316, 96%, 45%); + display:block; + text-align:center; + width:100%; + position:absolute; + bottom:-12px; + z-index:-100; +} + +.balloonString { + display:inline-block; top:153px; + position:absolute; + height:120px; + width:1px; + margin:0 auto; + content:""; + background:rgba(0,0,0,0.2); + z-index: -200; +} + +.balloon{ + background:hsl(316, 96%, 45%); + animation-duration:3.5s; +} + +.balloon:before { + color:hsl(316, 96%, 45%); +} + diff --git a/README.md b/README.md index 2d4efa8d..441f6ff6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +![image](https://camo.githubusercontent.com/baebe7bd53cddccd8bb2181cba613bca938163bb9451dea6dd3db58aa42137ba/68747470733a2f2f696d6775722e636f6d2f7775694a5871722e706e67) +------------------------------- + ![Community](https://github.com/GameSphere-MultiPlayer/Physi-c-Tech/assets/98798977/e79af9da-814e-487e-8a9a-85947384d3b2) ## Table of Contents @@ -97,6 +100,7 @@ ________________________________________________________________________________ | 41 | [Galaxy Rider](./SinglePlayer%20-%20Games/Galaxy_Rider) | | 42 | [Geek Tac Toe](./SinglePlayer%20-%20Games/GeekTacToe) | | 43 | [Guess The Number](./SinglePlayer%20-%20Games/Guess%20The%20Number) | +| 43 | [Guess The Sequence](./SinglePlayer%20-%20Games/Guess%20The%20Sequence) | | 44 | [Hangman Game](./SinglePlayer%20-%20Games/Hangman%20Game) | | 45 | [HexGL Master](./SinglePlayer%20-%20Games/HexGL-master) | | 46 | [Hover Board Effect](./SinglePlayer%20-%20Games/Hover_Board_Effect) | @@ -239,9 +243,17 @@ ________________________________________________________________________________ | 185 | [Math Sprint Game](.SinglePlayer%20-%20Games/Math_Sprint_Game) | | 186 | [Quick Type](.SinglePlayer%20-%20Games/QuickType) | | 187 | [SIMON_GAME](.SinglePlayer%20-%20Games/SIMON_GAME) | -| 188 | [Cubula_Game](.SinglePlayer%20-%20Games/Cubula_Game) | -| 189 | [Ball_Shooting_Game](.SinglePlayer%20-%20Games/Ball_Shooting_Game) | -| 190 | [Baseball_Game](.SinglePlayer%20-%20Games/Baseball_Game) | +| 188 | [Cubula_Game](.SinglePlayer%20-%20Games/Cubula_Game) | + +| 189 | [Ball_Shooting_Game](.SinglePlayer%20-%20Games/Ball_Shooting_Game) | +| 190 | [Baseball_Game](.SinglePlayer%20-%20Games/Baseball_Game) | +| 189 | [Hand_Cricket_Champ](./SinglePlayer%20-%20Games/Hand_Cricket_Champ) | +| 190 | [Pop My Balloon]() | +| 191 | [Doraemon Run](.SinglePlayer%20-%20Games/DoraemonRun) | +| 192 | [Hand_Cricket_Champ](./SinglePlayer%20-%20Games/Hand_Cricket_Champ) | +| 193 | [SnakeBites Game](./SinglePlayer%20-%20Games/SnakeBites) | +| 194 | [Ball_Shooting_Game](.SinglePlayer%20-%20Games/Ball_Shooting_Game) | +| 195 | [Baseball_Game](.SinglePlayer%20-%20Games/Baseball_Game) | diff --git a/SinglePlayer - Games/Angry Birds/Readme.md b/SinglePlayer - Games/Angry Birds/Readme.md new file mode 100644 index 00000000..dcdc0a6c --- /dev/null +++ b/SinglePlayer - Games/Angry Birds/Readme.md @@ -0,0 +1,16 @@ +# **Angry Bird game** + +--- + +
+ +## **Description ๐Ÿ“ƒ** + +In Angry Birds, players control a group of colorful birds with different abilities who are seeking revenge on a group of green pigs that have stolen their eggs. The objective of the game is to launch the birds from a slingshot and strategically destroy various structures and obstacles in order to eliminate the pigs and retrieve the stolen eggs. + +## **How to play? ๐Ÿ•น๏ธ** +- Use the mouse to launch the birds from a slingshot + +## **Screenshot +![image](https://github.com/manmita/GameSphere/blob/main/SinglePlayer%20-%20Games/Angry%20Birds/preview.png) + diff --git a/SinglePlayer - Games/Banner - image/D.png b/SinglePlayer - Games/Banner - image/D.png new file mode 100644 index 00000000..0cd5c678 Binary files /dev/null and b/SinglePlayer - Games/Banner - image/D.png differ diff --git a/SinglePlayer - Games/Banner - image/Hand_Cricket_Champ.png b/SinglePlayer - Games/Banner - image/Hand_Cricket_Champ.png new file mode 100644 index 00000000..b0b6296e Binary files /dev/null and b/SinglePlayer - Games/Banner - image/Hand_Cricket_Champ.png differ diff --git a/SinglePlayer - Games/Banner - image/Snake-game.png b/SinglePlayer - Games/Banner - image/Snake-game.png new file mode 100644 index 00000000..e93bab58 Binary files /dev/null and b/SinglePlayer - Games/Banner - image/Snake-game.png differ diff --git a/SinglePlayer - Games/Banner - image/guessthesequence.png b/SinglePlayer - Games/Banner - image/guessthesequence.png new file mode 100644 index 00000000..1631f840 Binary files /dev/null and b/SinglePlayer - Games/Banner - image/guessthesequence.png differ diff --git a/SinglePlayer - Games/Banner - image/snake.webp b/SinglePlayer - Games/Banner - image/snake.webp new file mode 100644 index 00000000..c9096568 Binary files /dev/null and b/SinglePlayer - Games/Banner - image/snake.webp differ diff --git a/SinglePlayer - Games/Banner - image/snakebite-slot-feat.webp b/SinglePlayer - Games/Banner - image/snakebite-slot-feat.webp new file mode 100644 index 00000000..c9096568 Binary files /dev/null and b/SinglePlayer - Games/Banner - image/snakebite-slot-feat.webp differ diff --git a/SinglePlayer - Games/Banner - image/snakebites.png b/SinglePlayer - Games/Banner - image/snakebites.png new file mode 100644 index 00000000..83d0692a Binary files /dev/null and b/SinglePlayer - Games/Banner - image/snakebites.png differ diff --git a/SinglePlayer - Games/DoremonRun/Doraemon run.mp4 b/SinglePlayer - Games/DoremonRun/Doraemon run.mp4 new file mode 100644 index 00000000..eabfc26f Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/Doraemon run.mp4 differ diff --git a/SinglePlayer - Games/DoremonRun/README.md b/SinglePlayer - Games/DoremonRun/README.md new file mode 100644 index 00000000..b33cc90b --- /dev/null +++ b/SinglePlayer - Games/DoremonRun/README.md @@ -0,0 +1,2 @@ +# RunDoraRun +Doraemon game diff --git a/SinglePlayer - Games/DoremonRun/Videos/Doraemon run.mp4 b/SinglePlayer - Games/DoremonRun/Videos/Doraemon run.mp4 new file mode 100644 index 00000000..eabfc26f Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/Videos/Doraemon run.mp4 differ diff --git a/SinglePlayer - Games/DoremonRun/image/D.png b/SinglePlayer - Games/DoremonRun/image/D.png new file mode 100644 index 00000000..0cd5c678 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/D.png differ diff --git a/SinglePlayer - Games/DoremonRun/image/Dora.png b/SinglePlayer - Games/DoremonRun/image/Dora.png new file mode 100644 index 00000000..311ea0e6 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/Dora.png differ diff --git a/SinglePlayer - Games/DoremonRun/image/PngItem_148881.png b/SinglePlayer - Games/DoremonRun/image/PngItem_148881.png new file mode 100644 index 00000000..6da4a949 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/PngItem_148881.png differ diff --git a/SinglePlayer - Games/DoremonRun/image/back.webp b/SinglePlayer - Games/DoremonRun/image/back.webp new file mode 100644 index 00000000..f732fdc2 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/back.webp differ diff --git a/SinglePlayer - Games/DoremonRun/image/chuaaa.mp3 b/SinglePlayer - Games/DoremonRun/image/chuaaa.mp3 new file mode 100644 index 00000000..bd678840 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/chuaaa.mp3 differ diff --git a/SinglePlayer - Games/DoremonRun/image/doracake.png b/SinglePlayer - Games/DoremonRun/image/doracake.png new file mode 100644 index 00000000..26df15e0 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/doracake.png differ diff --git a/SinglePlayer - Games/DoremonRun/image/doracake4.png b/SinglePlayer - Games/DoremonRun/image/doracake4.png new file mode 100644 index 00000000..febb6f19 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/doracake4.png differ diff --git a/SinglePlayer - Games/DoremonRun/image/food.mp3 b/SinglePlayer - Games/DoremonRun/image/food.mp3 new file mode 100644 index 00000000..076198c9 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/food.mp3 differ diff --git a/SinglePlayer - Games/DoremonRun/image/gameover.mp3 b/SinglePlayer - Games/DoremonRun/image/gameover.mp3 new file mode 100644 index 00000000..414bf651 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/gameover.mp3 differ diff --git a/SinglePlayer - Games/DoremonRun/image/grass_template2.jpg b/SinglePlayer - Games/DoremonRun/image/grass_template2.jpg new file mode 100644 index 00000000..3cb24b50 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/grass_template2.jpg differ diff --git a/SinglePlayer - Games/DoremonRun/image/move.mp3 b/SinglePlayer - Games/DoremonRun/image/move.mp3 new file mode 100644 index 00000000..4d3d245d Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/move.mp3 differ diff --git a/SinglePlayer - Games/DoremonRun/image/musicdoralarge.mp3 b/SinglePlayer - Games/DoremonRun/image/musicdoralarge.mp3 new file mode 100644 index 00000000..de88048e Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/musicdoralarge.mp3 differ diff --git a/SinglePlayer - Games/DoremonRun/image/smalldoral3.png b/SinglePlayer - Games/DoremonRun/image/smalldoral3.png new file mode 100644 index 00000000..807b19a4 Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/smalldoral3.png differ diff --git a/SinglePlayer - Games/DoremonRun/image/tasty.m4a b/SinglePlayer - Games/DoremonRun/image/tasty.m4a new file mode 100644 index 00000000..c78bd0be Binary files /dev/null and b/SinglePlayer - Games/DoremonRun/image/tasty.m4a differ diff --git a/SinglePlayer - Games/DoremonRun/index.html b/SinglePlayer - Games/DoremonRun/index.html new file mode 100644 index 00000000..712b565e --- /dev/null +++ b/SinglePlayer - Games/DoremonRun/index.html @@ -0,0 +1,21 @@ + + + + + + + fly to hell + + + +
+
+ +
+
High Score: 0
+
Score: 0
+ + + + + diff --git a/SinglePlayer - Games/DoremonRun/script.js b/SinglePlayer - Games/DoremonRun/script.js new file mode 100644 index 00000000..af5ce711 --- /dev/null +++ b/SinglePlayer - Games/DoremonRun/script.js @@ -0,0 +1,361 @@ +// initialisation +let inputDir = { x: 0, y: 0 }; +const musicSound = new Audio('image/musicdoralarge.mp3'); +const movesound = new Audio('image/move.mp3'); +const foodsound = new Audio('image/food.mp3'); +const gameover = new Audio('image/gameover.mp3'); +const chuaa = new Audio('image/chuaaa.mp3'); +const tasty = new Audio('image/tasty.m4a'); + +let score = 0; +let speed = 4.9; +let health = 5.0; +let lastPaintTime = 0.0; +let snakeArr = [{ x: 11, y: 11 }]; +food = { x: 11, y: 5 }; + +mouse1 = { x: 13, y: 8 };//immovable mouse +mouse2 = { x: 9, y: 7 }; +mouse3 = { x: 4, y: 4 }; +mouse4 = { x: 10, y: 14 }; +mouse5 = { x: 9, y: 13 }; + + + +let topp = false; +let down = false; +let left = false; +let right = false; + +let safter = 0; + +let aa = 1; +let bb = 16; +let a = 2; +b = 17; + + + + + +//my functions +function mousedead() { + + //display mouse + mouseElement = document.createElement('div'); + mouseElement.style.gridRowStart = mouse1.y; + mouseElement.style.gridColumnStart = mouse1.x; + mouseElement.classList.add('mouse'); + board.appendChild(mouseElement); + + //display mouse + mouseElement = document.createElement('div'); + mouseElement.style.gridRowStart = mouse2.y; + mouseElement.style.gridColumnStart = mouse2.x; + mouseElement.classList.add('mouse'); + board.appendChild(mouseElement); + + //display mouse + mouseElement = document.createElement('div'); + mouseElement.style.gridRowStart = mouse3.y; + mouseElement.style.gridColumnStart = mouse3.x; + mouseElement.classList.add('mouse'); + board.appendChild(mouseElement); + + //display mouse + mouseElement = document.createElement('div'); + mouseElement.style.gridRowStart = mouse4.y; + mouseElement.style.gridColumnStart = mouse4.x; + mouseElement.classList.add('mouse'); + board.appendChild(mouseElement); + + //display mouse + mouseElement = document.createElement('div'); + mouseElement.style.gridRowStart = mouse5.y; + mouseElement.style.gridColumnStart = mouse5.x; + mouseElement.classList.add('mouse'); + board.appendChild(mouseElement); + + if ((snakeArr[0].y === mouse1.y && snakeArr[0].x === mouse1.x) || (snakeArr[0].y === mouse2.y && snakeArr[0].x === mouse2.x) || (snakeArr[0].y === mouse3.y && snakeArr[0].x === mouse3.x) || snakeArr[0].y === mouse4.y && snakeArr[0].x === mouse4.x||(snakeArr[0].y === mouse5.y && snakeArr[0].x === mouse5.x)) { + health--; + chuaa.play(); + // incerease speed + if(speed<8){ + speed = speed+0.1 + } + else if(speed >= 8 && speed < 10){ + speed = speed + 0.09; + } + else if(speed >= 10 && speed < 11.6){ + speed =speed + 0.068; + } + else if(speed >= 11.6){ + speed = speed +0.032; + } + } + +} + +function healthplus(staken) { + if (staken != safter) + if (score % 8 === 0 && score != 0) { + health = health + 1; + } + else { + return; + } + safter = staken; +} + + +//functions + +// main function +function main(ctime) { + + window.requestAnimationFrame(main); + + if ((ctime - lastPaintTime) / 1000 < 1 / speed) { + return; + } + lastPaintTime = ctime; + gameEngine(); +} + +//if you bump on mouse or over the boundry +function isCollide(snake) { + + if (snake[0].x >= 18 || snake[0].x <= 0 || snake[0].y >= 18 || snake[0].y <= 0) { + return true; + } + if (health == 0) { + return true; + } +} + +// gameEngine function +function gameEngine() { + + // if collided + if (isCollide(snakeArr)) { + gameover.play(); + musicSound.pause(); + inputDir = { x: 0, y: 0 }; + alert('Game Over. Press any key to play again'); + snakeArr = [{ x: 4, y: 17 }]; + musicSound.play(); + score = 0; + scorebox.innerHTML = "Score: " + score; + health = 5; + healthbox.innerHTML = "Health: " + health; + speed = 4.5; + snakeElement.style.rotate = '360deg'; + topp = false; + down = false; + left = false; + right = false; + healthbox.style.color = 'rgb(0, 255, 0)'; + snakeElement.classList.remove('can'); + } + + + + // if dora has eaten doracake, increment score and regenerate food + if (snakeArr[0].y === food.y && snakeArr[0].x === food.x) { + foodsound.play(); + tasty.play(); + + // score + score++; + + // incerease speed + if(speed<8){ + speed = speed+0.1 + } + else if(speed >= 8 && speed < 10){ + speed = speed + 0.09; + } + else if(speed >= 10 && speed < 11.6){ + speed =speed + 0.068; + } + else if(speed >= 11.6){ + speed = speed +0.032; + } + + scorebox.innerHTML = "Score: " + score; + // hiscore + if (score > hiscore) { + hiscoreval = score; + localStorage.setItem("hiscore", JSON.stringify(hiscoreval)); + hiscorebox.innerHTML = "Hi Score: " + hiscoreval; + } + //regenfood + food = { x: Math.round(a + (bb - aa) * Math.random()), y: Math.round(aa + (bb - aa) * Math.random()) }; + + mouse1 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + + mouse2 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + + mouse3 = { x: Math.round(a + (b - aa) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + + mouse4 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + + mouse5 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + //regenmouse + + if (food.x === mouse4.x && food.y === mouse4.y) { + mouse4 = { x: (food.x + 2), y: 14 }; + } + + if (food.x === mouse3.x && food.y === mouse3.y) { + mouse3 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + } + + if (food.x === mouse2.x && food.y === mouse2.y) { + mouse2 = { x: 10, y: (food.y+1) }; + } + + if (food.x === mouse1.x && food.y === mouse1.y) { + mouse1 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + } + + if (food.x === mouse5.x && food.y === mouse5.y) { + mouse5 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + } + + } + + //missing for loop for body increment + snakeArr[0].x += inputDir.x; + snakeArr[0].y += inputDir.y; + + + // clean board except doraemon + const board = document.getElementById('board'); + const children = Array.from(board.children); + + const childrenToClear = children.filter(child => child.id !== 'dora' && child.id !== 'heartid'); + + childrenToClear.forEach(child => child.remove()); + + + //display snake + snakeArr.forEach((e, index) => { + snakeElement = document.getElementById('dora'); + // console.log(snakeElement) + snakeElement.style.gridRowStart = e.y; + snakeElement.style.gridColumnStart = e.x; + }) + + + // display food + foodElement = document.createElement('div'); + foodElement.style.gridRowStart = food.y; + foodElement.style.gridColumnStart = food.x; + foodElement.classList.add('food'); + board.appendChild(foodElement); + + + + //display mouse + mousedead(); + + // rotate /////// + if (topp === true) { + snakeElement.style.rotate = '270deg'; + } + if (down === true) { + snakeElement.style.rotate = '90deg'; + } + if (left === true) { + snakeElement.style.rotate = '180deg'; + } + if (right) { + snakeElement.style.rotate = '360deg'; + } + + + // Change healthtext color + if (health === 3) { + healthbox.style.color = 'rgb(255, 150, 0)' + } + if (health <= 2) { + healthbox.style.color = 'rgb(255, 0, 0)'; + } + + + // increase health on eating per 8 doracakes + healthplus(score); + healthbox.innerHTML = "Health: " + health; + + + // increasing animation speed + if(speed>=5){ + snakeElement.style.animation= 'walky 1s steps(6) infinite'; + } + if(speed>=10){ + snakeElement.style.animation= 'walky 0.9s steps(6) infinite'; + } + + +} //End of gameEngine() + + +// main logic +let hiscore = localStorage.getItem("hiscore"); +if (hiscore === null) { + hiscoreval = 0; + localStorage.setItem("hiscore", JSON.stringify(hiscoreval)); +} +else { + hiscoreval = JSON.parse(hiscore); + hiscorebox.innerHTML = "Hi Score: " + hiscoreval; +} + +setTimeout(() => { + alert("Controls:\nUp Aroow\nDown Arrow\nLeft Arrow\nRight Arrow"); +}, 500); +window.requestAnimationFrame(main); +window.addEventListener('keydown', e => { + + topp = false; + down = false; + left = false; + right = false; + snakeElement.classList.add('can'); + inputDir = { x: 0, y: 1 } //start the game + switch (e.key) { + case "ArrowUp": + console.log("up"); + inputDir.x = 0; + inputDir.y = -1; + topp = true; + if(score>5){ + mouse5 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + } + break; + case "ArrowDown": + console.log("down"); + inputDir.x = 0; + inputDir.y = 1; + down = true; + if(score>15){ + mouse3 = { x: Math.round(a + (b - a) * Math.random()), y: Math.round(a + (b - a) * Math.random()) }; + } + break; + case "ArrowLeft": + console.log("left"); + inputDir.x = -1; + inputDir.y = 0; + left = true; + break; + case "ArrowRight": + console.log("right"); + inputDir.x = 1; + inputDir.y = 0; + right = true; + break; + } + musicSound.play(); +}); + diff --git a/SinglePlayer - Games/DoremonRun/styles.css b/SinglePlayer - Games/DoremonRun/styles.css new file mode 100644 index 00000000..0412a302 --- /dev/null +++ b/SinglePlayer - Games/DoremonRun/styles.css @@ -0,0 +1,117 @@ +@import url('https://fonts.googleapis.com/css2?family=New+Tegomin&display=swap'); + +* { + padding: 0; + margin: 0; +} + +body { + background: url(image/back.webp); + /* background-color: rgba(20, 157, 163, 1); */ + /* min-height: 100vw; */ + /* background-repeat: no-repeat; */ + display: flex; + background-size: 100vw 100vh; + justify-content: center; + align-items: center; +} + +#board { + background: url(image/grass_template2.jpg); + /* background-color: rgba(0, 255, 55, 0.581); */ + width: 130vmin; + /* width: 90vmin; */ + height: 99vmin; + border: 2px solid black; + display: grid; + grid-template-rows: repeat(17, 1fr); + grid-template-columns: repeat(17, 1fr); +} + +/* doarmon + animation */ +.man { + background: url(image/smalldoral3.png); + width: 40px; + margin: auto; + height: 50px; +} + + +.can { + animation: walky 1.2s steps(6) infinite; + /* forwards 5s linear infinite; */ + transition: grid-row-start 1s ease-out, grid-column-start 1s ease-out; +} + +@keyframes walky { + 0% { + background-position: 0px; + } + + 100% { + background-position: 242px; + } +} + +@keyframes forward { + 0% { + transform: translateX(-100px); + } + + 100% { + transform: translateX(1500px); + } +} + + +/* over */ + + +.food { + background: url(image/doracake4.png); + background-repeat: no-repeat; +} + +.mouse { + background: url(image/PngItem_148881.png); + background-repeat: no-repeat; +} + + +/* score */ + +#hiscorebox { + position: absolute; + right: 90px; + top: 20px; + font-family: 'New Tegomin', serif; + background-color: rgba(3, 3, 3, 0.597); + border-radius: 5px; + padding: 3px 6px; + font-size: 20px; + color: white; +} + +#scorebox { + position: absolute; + right: 130px; + top: 63px; + font-family: 'New Tegomin', serif; + background-color: rgba(3, 3, 3, 0.597); + border-radius: 5px; + padding: 3px 6px; + font-size: 20px; + color: white; +} + +#healthbox { + position: absolute; + right: 118px; + top: 107px; + font-family: 'New Tegomin', serif; + background-color: rgba(3, 3, 3, 0.597); + border-radius: 5px; + padding: 3px 6px; + font-size: 20px; + color: rgb(26, 255, 0); +} diff --git a/SinglePlayer - Games/General Knowledge Quiz/bg.jpg b/SinglePlayer - Games/General Knowledge Quiz/bg.jpg new file mode 100644 index 00000000..1684897a Binary files /dev/null and b/SinglePlayer - Games/General Knowledge Quiz/bg.jpg differ diff --git a/SinglePlayer - Games/General Knowledge Quiz/index.html b/SinglePlayer - Games/General Knowledge Quiz/index.html new file mode 100644 index 00000000..574c120c --- /dev/null +++ b/SinglePlayer - Games/General Knowledge Quiz/index.html @@ -0,0 +1,77 @@ + + + + + + Quiz + + + + + + +
+ + +
+
+
Awesome Quiz Application
+
+
Time Left
+
15
+
+
+
+ +
+
+ What does HTML stand for? +
+
+ +
+
+ + +
+
+ +
+ +
+
+ + +
+
+ +
+
You've completed the Quiz!
+
+ +
+
+ + +
+
+ + + + + \ No newline at end of file diff --git a/SinglePlayer - Games/General Knowledge Quiz/js/questions.js b/SinglePlayer - Games/General Knowledge Quiz/js/questions.js new file mode 100644 index 00000000..69e461cb --- /dev/null +++ b/SinglePlayer - Games/General Knowledge Quiz/js/questions.js @@ -0,0 +1,59 @@ +//creating an array and passing the number, questions, and answers + +let questions = [ + { + numb: 1, + question: "What does HTML stand for?", + answer: "Hyper Text Markup Language", + options: [ + "Hyper Text Preprocessor", + "Hyper Text Markup Language", + "Hyper Text Multiple Language", + "Hyper Tool Multi Language" + ] + }, + { + numb: 2, + question: "What does CSS stand for?", + answer: "Cascading Style Sheet", + options: [ + "Commomn Style Sheet", + "Colorful Style Sheet", + "Computer Style Sheet", + "Cascading Style Sheet" + ] + }, + { + numb: 3, + question: "What does PHP stand for?", + answer: "Hypertext Preprocessor", + options: [ + "Hypertext Preprocessor", + "Hypertext Programming", + "Hypertext Preprogramming", + "Hometext Preprocessor" + ] + }, + { + numb: 4, + question: "What does SQL stand for?", + answer: "Structured Query Language", + options: [ + "Stylish Question Language", + "Stylesheet Query Language", + "Statement Question Language", + "Structured Query Language" + ] + }, + { + numb: 5, + question: "What does XML stand for?", + answer: "eXtensible Markup Language", + options: [ + "eXtensible Markup Language", + "eXecutable Multiple Language", + "eXtra Multi-Program Language", + "eXamine Multiple Language" + ] + }, +]; \ No newline at end of file diff --git a/SinglePlayer - Games/General Knowledge Quiz/js/script.js b/SinglePlayer - Games/General Knowledge Quiz/js/script.js new file mode 100644 index 00000000..3dc1a659 --- /dev/null +++ b/SinglePlayer - Games/General Knowledge Quiz/js/script.js @@ -0,0 +1,206 @@ +//getting all required elements +const start_btn = document.querySelector(".start_btn button"); +const quiz_box = document.querySelector(".quiz_box"); +const timeCount = quiz_box.querySelector(".timer .time_sec"); +const timeLine = quiz_box.querySelector("header .time_line"); +const timeOff = quiz_box.querySelector("header .time_text"); + +const option_list = document.querySelector(".option_list"); + + + +//If Start Quiz button clicked +start_btn.onclick = () => { + quiz_box.classList.add("activeQuiz"); //show the quiz now + showQuestions(0); + queCounter(1); + startTimer(15); + startTimerLine(0); +} + +let que_count = 0; +let que_numb = 1; +let counter; +let counterLine; +let timeValue = 15; +let widthValue = 0; +let userScore = 0; + + +const next_btn = quiz_box.querySelector(".next_btn"); +const result_box = document.querySelector(".result_box"); +const restart_quiz = result_box.querySelector(".buttons .restart"); +const quit_quiz = result_box.querySelector(".buttons .quit"); + +restart_quiz.onclick = () => { + quiz_box.classList.add("activeQuiz"); //show the quiz now + result_box.classList.remove("activeResult"); + let que_count = 0; + let que_numb = 1; + let timeValue = 15; + let widthValue = 0; + let userScore = 0; + showQuestions(que_count); + queCounter(que_numb); + clearInterval(counter); + startTimer(timeValue); + clearInterval(counterLine); + startTimerLine(widthValue); + next_btn.style.display = "none"; + timeOff.textContent = "Time Left"; +} + + + +quit_quiz.onclick = () => { + window.location.reload(); +} + +//If Next button clicked +next_btn.onclick = () => { + if(que_count < questions.length - 1){ + que_count++; + que_numb++; + showQuestions(que_count); + queCounter(que_numb); + clearInterval(counter); + startTimer(timeValue); + clearInterval(counterLine); + startTimerLine(widthValue); + next_btn.style.display = "none"; + timeOff.textContent = "Time Left"; + } + else{ + clearInterval(counter); + clearInterval(counterLine); + console.log("Questions completed"); + showResultBox(); + } +} + +//getting questions and options from array +function showQuestions(index) { + const que_text = document.querySelector(".que_text"); + let que_tag = '' + questions[index].numb + ". " + questions[index].question + ''; + let option_tag = '
' + questions[index].options[0] + '
' + + '
' + questions[index].options[1] + '
' + + '
' + questions[index].options[2] + '
' + + '
' + questions[index].options[3] + '
'; + que_text.innerHTML = que_tag; + option_list.innerHTML = option_tag; + + const option = option_list.querySelectorAll(".option"); + for (let i = 0; i < option.length; i++) { + option[i].setAttribute("onclick", "optionSelected(this)"); + } +} + +let tickIcon = '
'; +let crossIcon = '
'; + + +function optionSelected(answer){ + clearInterval(counter); + clearInterval(counterLine); + let userAns = answer.textContent; + let correctAns = questions[que_count].answer; + let allOptions = option_list.children.length; + if(userAns == correctAns){ + userScore += 1; + console.log(userScore); + answer.classList.add("correct"); + console.log("Answer is Correct"); + answer.insertAdjacentHTML("beforeend", tickIcon); + } + else{ + answer.classList.add("incorrect"); + console.log("Answer is Wrong"); + answer.insertAdjacentHTML("beforeend", crossIcon); + + + //if answers is incorrect then autometically selected the correct ans + for (let i = 0; i < allOptions; i++) { + if (option_list.children[i].textContent == correctAns){ + option_list.children[i].setAttribute("class", "option correct"); + option_list.children[i].insertAdjacentHTML("beforeend", tickIcon); + + } + } + } + + //once user selected disabled all options + for (let i = 0; i < allOptions; i++){ + option_list.children[i].classList.add("disabled"); + } + next_btn.style.display = "block"; +} + +function showResultBox(){ + quiz_box.classList.remove("activeQuiz"); //hide the quiz now + result_box.classList.add("activeResult"); //show the result now + const scoreText = result_box.querySelector(".score_text"); + if (userScore > 3){ + let scoreTag = 'and congrats! You got

'+ userScore +'

out of

'+ questions.length +'

'; + scoreText.innerHTML = scoreTag; + } + else if (userScore > 1){ + let scoreTag = 'and nice, You got

'+ userScore +'

out of

'+ questions.length +'

'; + scoreText.innerHTML = scoreTag; + } + else{ + let scoreTag = 'and sorry, You got only

'+ userScore +'

out of

'+ questions.length +'

'; + scoreText.innerHTML = scoreTag; + } +} + +function startTimer(time){ + counter = setInterval(timer, 1000); + function timer(){ + timeCount.textContent = time; + time--; + if(time < 9){ + let addZero =timeCount.textContent; + timeCount.textContent = "0" + addZero; + } + if(time < 0){ + clearInterval(counter); + timeCount.textContent = "00"; + timeOff.textContent = "Time Off"; + + let correctAns = questions[que_count].answer; + let allOptions = option_list.children.length; + + for (let i = 0; i < allOptions; i++) { + if (option_list.children[i].textContent == correctAns){ + option_list.children[i].setAttribute("class", "option correct"); + option_list.children[i].insertAdjacentHTML("beforeend", tickIcon); + + } + } + for (let i = 0; i < allOptions; i++){ + option_list.children[i].classList.add("disabled"); + } + next_btn.style.display = "block"; + } + } +} + +function startTimerLine(time){ + counterLine = setInterval(timer, 29); + function timer(){ + time += 1; + timeLine.style.width = time +"px"; + if(time > 549){ + clearInterval(counterLine); + } + } +} + + + + +function queCounter(index) { + const bottom_ques_counter = quiz_box.querySelector(".total_que"); + let totalQuesCountTag = '

'+ index +'

of

'+ questions.length +'

Questions
'; + bottom_ques_counter.innerHTML = totalQuesCountTag; +} diff --git a/SinglePlayer - Games/General Knowledge Quiz/style.css b/SinglePlayer - Games/General Knowledge Quiz/style.css new file mode 100644 index 00000000..e1e7c6e8 --- /dev/null +++ b/SinglePlayer - Games/General Knowledge Quiz/style.css @@ -0,0 +1,305 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap'); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins',sans-serif; +} + +body{ + background-image: url(./bg.jpg); +} + +.start_btn, .quiz_box, .result_box{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + box-shadow: 0px 4px 8px 0 rgba(0, 0, 0, 0.2), + 0px 6px 20px 0 rgba(0, 0, 0, 0.19); + transition: all 0.3s ease; +} + +.quiz_box.activeQuiz, +.result_box.activeResult{ + + z-index: 5; + opacity: 1; + pointer-events: auto; + transform: translate(-50%, -50%) scale(1); +} + +.start_btn button{ + font-size: 25px; + font-weight: 500; + color: #d6bf6a; + padding: 15px 30px; + outline: none; + border: none; + border-radius: 10px; + background: #fff; + cursor: pointer; +} + +.quiz_box{ + width: 550px; + background: #fff; + border-radius: 5px; + opacity: 0; + pointer-events: none; + transform: translate(-50%, -50%) scale(0.9); +} + +.quiz_box header{ + position: relative; + z-index: 99; + height: 70px; + padding: 0 30px; + background: #fff; + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 5px 5px 0 0; + box-shadow: 0px 3px 5px 1px rgba(0, 0, 0, 0.1); +} + +.quiz_box header .title{ + font-size: 20px; + font-weight: 600; +} + +.quiz_box header .timer{ + display: flex; + align-items: center; + justify-content: space-between; + width: 145px; + height: 45px; + background: #decc8c; + border: 1px solid #ffe893; + border-radius: 5px; + padding: 0 8px; +} + +.quiz_box header .timer .time_text{ + font-weight: 400; + font-size: 17px; + user-select: none; +} + +.quiz_box header .timer .time_sec{ + font-size: 18px; + font-weight: 500; + background: #343a40; + height: 30px; + width: 45px; + color: #fff; + text-align: center; + line-height: 30px; + border-radius: 5px; + border: 1px solid #343a40; + user-select: none; +} + +.quiz_box header .time_line{ + position: absolute; + bottom: 0px; + height: 3px; + left: 0px; + background: #d6bf6a; +} + +.quiz_box section{ + padding: 25px 30px 20px 30px; + background: #fff; +} + +.quiz_box section .que_text{ + font-size: 25px; + font-weight: 600; +} + +.quiz_box section .option_list{ + padding: 20px 0; + display: block; +} + +section .option_list .option{ + background: #f8f6f0; + border: 1px solid #c2ad5f; + border-radius: 5px; + padding: 8px 15px; + margin-bottom: 15px; + font-size: 17px; + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + transition: all 0.3s ease; +} + +section .option_list .option:hover{ + color: #fff; + background: #dccd97; + border-color: #cbb97a; +} + +.option_list .option:last-child{ + margin-bottom: 0px; +} + +.option_list .option .icon{ + height: 26px; + width: 26px; + border: 2px solid transparent; + border-radius: 50%; + text-align: center; + font-size: 13px; + line-height: 24px; + pointer-events: none; +} + +.option_list .option .icon.tick{ + color: #23903c; + border-color: #23903c; + background: #d4edda; +} + +.option_list .option .icon.cross{ + color: #a42834; + border-color: #a42834; + background: #f8d7da; +} + +.option_list .option.correct{ + color: #155724; + border-color: #c3e6cb; + background: #d4edda; +} + +.option_list .option.incorrect{ + color: #721c24; + border-color: #f5c6cb; + background: #f8d7da; +} + +.option_list .option.disabled{ + pointer-events: none; +} + +.quiz_box footer{ + height: 60px; + width: 100%; + padding: 0 30px; + display: flex; + align-items: center; + justify-content: space-between; +} + +.quiz_box footer .total_que span{ + display: flex; + user-select: none; +} + +footer .total_que span p{ + font-weight: 500; + padding: 0 5px; +} + +.total_que span p:first-child{ + padding-left: 0px; +} + +footer .next_btn{ + display: none; + height: 40px; + padding: 0 13px; + font-size: 18px; + font-weight: 400; + border: none; + outline: none; + color: #fff; + background: #d6bf6a; + border-radius: 5px; + border: 1px solid #d6bf6a; + cursor: pointer; + transition: all 0.3s ease; +} + +footer .next_btn:hover{ + background: #bfa64c; +} + +.result_box{ + background: #fff; + width: 450px; + padding: 25px 30px; + border-radius: 5px; + display: flex; + text-align: center; + align-items: center; + flex-direction: column; + justify-content: space-between; + opacity: 0; + pointer-events: none; + transform: translate(-50%, -50%) scale(0.9); +} + +.result_box .icon{ + font-size: 100px; + color: #d6bf6a; + margin-bottom: 10px; +} + +.result_box .complete_text{ + font-size: 20px; + font-weight: 500; +} + +.result_box .score_text span{ + display: flex; + margin: 10px 0; + font-size: 18px; + font-weight: 500; +} + +.score_text span p{ + font-weight: 600; + padding: 0 4px; +} + +.result_box .buttons{ + display: flex; + margin: 20px 0; +} + +.result_box .buttons button{ + margin: 0 10px; + height: 40px; + padding: 0 20px; + border: none; + outline: none; + font-size: 18px; + font-weight: 500; + border-radius: 5px; + border: 1px solid #d6bf6a; + cursor: pointer; + transition: all 0.3s ease; +} + +.buttons button.restart{ + color: #fff; + background: #d6bf6a; +} + +.buttons button.restart:hover{ + background: #bfa64c; +} + +.buttons button.quit{ + color: #d6bf6a; +} + +.buttons button.quit:hover{ + color: #fff; + background: #d6bf6a; +} \ No newline at end of file diff --git a/SinglePlayer - Games/Guess The Sequence/index.html b/SinglePlayer - Games/Guess The Sequence/index.html new file mode 100644 index 00000000..19364e2e --- /dev/null +++ b/SinglePlayer - Games/Guess The Sequence/index.html @@ -0,0 +1,52 @@ + + + + + + Guess the Sequence + + + + +

Guess the sequence

+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ + +
+
+
+

Congratulations, you won!

+ +
+
+ + + \ No newline at end of file diff --git a/SinglePlayer - Games/Guess The Sequence/script.js b/SinglePlayer - Games/Guess The Sequence/script.js new file mode 100644 index 00000000..ad74d75f --- /dev/null +++ b/SinglePlayer - Games/Guess The Sequence/script.js @@ -0,0 +1,218 @@ +const colors = ['#F44336','#4CAF50','#03A9F4','#FFEB3B',"#673AB7","#795548","#FF5722","#212121"] +let sequence = [] +let numberOfColors=0 +let sequenceSize =0 +let maxAttemps=0 +let currentAttemp = 0 +let currentGuess = [] +let currentGuessDots=[] +let currentGuessIndex=0 + +let confettiInterval + +function GenerateSequence() +{ + for(let i = 0;i element ==currentGuess[i]).length + if(correctColorPosition.filter(element => element ==currentGuess[i]).length < numberOfColorInSequence) + { + let k = 0 + for(let j=0;j { + showConfetti(); + }, 400); + } +} + +const showConfetti = () => { + + const confettiContainer = document.querySelector('#confetti-container'); + const confetti = document.createElement('div'); + confetti.textContent = '๐ŸŽ‰'; + confetti.classList.add('confetti'); + confetti.style.left = Math.random() * innerWidth + 'px'; + confettiContainer.appendChild(confetti); + setTimeout(() => { + confetti.remove(); + }, 5000); + }; + +function newGame() +{ + document.getElementById("confetti-container").style.visibility = "hidden" + document.getElementById("menu").style.visibility = "hidden" + sequence = [] + difficultySelect = document.getElementById("difficulty").options; + difficultyValue = difficultySelect[difficultySelect.selectedIndex].value + if(difficultyValue === "Easy") + { + numberOfColors = 4 + sequenceSize = 3 + maxAttemps = 6 + } + else if(difficultyValue === "Medium") + { + numberOfColors = 5 + sequenceSize = 4 + maxAttemps = 6 + } + else if(difficultyValue === "Hard") + { + numberOfColors = 6 + sequenceSize = 5 + maxAttemps = 6 + } + currentAttemp = 0 + currentGuess = [] + currentGuessDots=[] + currentGuessIndex=0 + const colorsContainer = document.getElementById("colors") + while (colorsContainer.firstChild) colorsContainer.removeChild(colorsContainer.firstChild); + const guessesContainer = document.getElementById("guesses") + while (guessesContainer.firstChild) guessesContainer.removeChild(guessesContainer.firstChild); + const resultsContainer = document.getElementById("results") + while (resultsContainer.firstChild) resultsContainer.removeChild(resultsContainer.firstChild); + + document.getElementById("attempsLeft").innerText="Attempts left: " + (maxAttemps - currentAttemp).toString() + + GenerateSequence() + createGuessColors(); + createGuessSequence() +} + +function wonButton() +{ + clearInterval(confettiInterval) + showMenu() +} + +function showMenu() +{ + document.getElementById("confetti-container").style.visibility = "hidden" + document.getElementById("menu").style.visibility = "visible" +} + + +window.onload = function(){ + showMenu() + +} \ No newline at end of file diff --git a/SinglePlayer - Games/Guess The Sequence/styles.css b/SinglePlayer - Games/Guess The Sequence/styles.css new file mode 100644 index 00000000..0d6cbd4c --- /dev/null +++ b/SinglePlayer - Games/Guess The Sequence/styles.css @@ -0,0 +1,155 @@ +body { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin: 0 auto; + height: 100vh; + background-color: #37474F; + box-sizing: content-box; + overflow: hidden; + padding: 0; + font-family: Verdana, Geneva, Tahoma, sans-serif; + } + + +.dot { + height: 50px; + width: 50px; + background-color: #313b4b; + border-radius: 100%; + display: inline-block; + outline: solid 5px #757575; + margin: 10px; + + } + +#game{ + width: 1000px; + height: 600px; + display: flex; + flex-direction: row; + } + +#guesses +{ + width: 500px; + display:block; +} + +.guess + { + width:100; + height: 100; + justify-content: center; + align-items: center; + text-align:center; + display:flex; + } + +#colors + { + width:40; + justify-content:left; + text-align:center; + align-items: center; + display: flex; + flex-direction: column; + } + +#results +{ + width: 500px; + display:block; +} + +.result +{ + width:100; + height: 100; + justify-content: center; + align-items: center; + text-align:center; + display:flex; +} + +#check +{ + width: 1000px; + display:flex; + padding: 0.5%; + align-items: center; + text-align: center; + justify-content: center; +} + +#confetti-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + height: 100vh; +} + +#menu { + position: absolute; + top: 0; + left: 0; + width: 100%; + display: flex; + align-items: center; + text-align: center; + justify-content: center; + height: 100vh; +} + +.card { + background-color: #90A4AE; + max-width: 700px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + padding: 2rem; +} + +.card p { + font-size: 1.2rem; + text-align: center; + margin: 0; + padding: 10px; +} + +.confetti { + position: absolute; + top: 0; + font-size: 1.6rem; + animation: confetti-fall linear 5s infinite; +} + +@keyframes confetti-fall { + 0% { + transform: translateY(-100%) rotate(0); + } + 100% { + transform: translateY(100vh) rotate(180deg); + } +} + +.button +{ + position: relative; + overflow: hidden; + color: #fff; + background-color: #01579B; + padding: 0.5rem 1rem; + font-family: 'Roboto', sans-serif; + font-size: 1.0rem; + outline: 0; + border: 0; + margin: 10px; + border-radius: 0.20rem; + box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.3); + cursor: pointer; +} \ No newline at end of file diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/fistL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/fistL.png new file mode 100644 index 00000000..4a1c9426 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/fistL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/fistR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/fistR.png new file mode 100644 index 00000000..c30a5f61 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/fistR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/fiveL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/fiveL.png new file mode 100644 index 00000000..95eea6b8 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/fiveL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/fiveR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/fiveR.png new file mode 100644 index 00000000..746dec51 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/fiveR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/fourL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/fourL.png new file mode 100644 index 00000000..0431126c Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/fourL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/fourR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/fourR.png new file mode 100644 index 00000000..0c3e867a Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/fourR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/oneL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/oneL.png new file mode 100644 index 00000000..2d4a881e Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/oneL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/oneR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/oneR.png new file mode 100644 index 00000000..a7b8ad01 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/oneR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/sixL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/sixL.png new file mode 100644 index 00000000..a2ddd096 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/sixL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/sixR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/sixR.png new file mode 100644 index 00000000..afc86c84 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/sixR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/threeL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/threeL.png new file mode 100644 index 00000000..5b7f1e53 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/threeL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/threeR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/threeR.png new file mode 100644 index 00000000..72e32b40 Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/threeR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/twoL.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/twoL.png new file mode 100644 index 00000000..f0d0c9cd Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/twoL.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/images/twoR.png b/SinglePlayer - Games/Hand_Cricket_Champ/images/twoR.png new file mode 100644 index 00000000..d36d078b Binary files /dev/null and b/SinglePlayer - Games/Hand_Cricket_Champ/images/twoR.png differ diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/index.html b/SinglePlayer - Games/Hand_Cricket_Champ/index.html new file mode 100644 index 00000000..69ac18f5 --- /dev/null +++ b/SinglePlayer - Games/Hand_Cricket_Champ/index.html @@ -0,0 +1,134 @@ + + + + + + Hand Cricket Champ + + + + + +
+
+

Hand Cricket Champ

+

+ Welcome to Hand Cricket Champ, where every flick counts towards your victory! Play against the computer and test your skills in this thrilling game of strategy and precision. Aim for the highest scores with each flick of your finger. Experience the excitement of cricket at your fingertips in Finger Flick Cricket. +

+
+ +
+ + +
+
+
+ +
+
+ +
How to Play Hand Cricket
+
Objective:
+
Score more runs than the computer or dismiss the computer player.
+ +
Player:
+
You will play against the computer.
+ +
Instructions:
+
1. Batting:
+
Choose a number between 1 and 6.The computer will do same.If your numbers match, you're out. Otherwise, your runs are added to your total score.There is no limit to the number of balls (guesses) per inning. + +
2. Bowling (Computer's turn):
+
The computer tries to guess your chosen number. If the computer guesses correctly, you're out. Otherwise, your runs are added to your total score.
+ +
3. Switch Roles:
+
After each inning (when you get out or score runs), the computer bats and you bowl.
+ +
4. Scoring:
+
Runs are based on the numbers chosen by you and the computer.If you're out, no runs are scored for that inning.
+ +
5. Winner:
+
The player with the highest total score wins.
+ +
+ +
+
+ + +
+ +

H

+
+ + +
+
+
+ +
+
+
+

Congratulations!

+

You Won the Toss

+
+
+

What would you like to do?

+ + +
+
+
+ + +
+
+ +

Player

+

0

+
+ +

Computer

+

0

+
+
+ +
+ + + + + Let's
Start +
+ + + +
+ +
+ + + + + + +
+
+
+ + +
+
+

Congratulations!

+

You Won!!

+
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/script.js b/SinglePlayer - Games/Hand_Cricket_Champ/script.js new file mode 100644 index 00000000..b1ede0f9 --- /dev/null +++ b/SinglePlayer - Games/Hand_Cricket_Champ/script.js @@ -0,0 +1,454 @@ +const run_1 = document.getElementById("run_1"); +const run_2 = document.getElementById("run_2"); +const run_3 = document.getElementById("run_3"); +const run_4 = document.getElementById("run_4"); +const run_5 = document.getElementById("run_5"); +const run_6 = document.getElementById("run_6"); + +document.getElementById("Instructions").style.display = "none"; +document.getElementById("toss").style.display = "none"; +document.getElementById("toss-res").style.display = "none"; +document.getElementById("game").style.display = "none"; +document.getElementById("results").style.display = "none"; + + +var comp_toss_win_choice = -1; + +function tossStart() { + document.getElementById("landing").style.display = "none"; + document.getElementById("toss").style.display = "flex"; +} + +function flipCoin(userChoice) { + var randomValue = Math.random(); + const coin = document.getElementById('coin'); + if (randomValue >= 0.5) { + coin.style.transform = 'rotateX(720deg)'; + document.getElementById("res").innerHTML = "H"; + } else { + coin.style.transform = 'rotateX(-720deg)'; + document.getElementById("res").innerHTML = "T"; + } + + setTimeout(() => { + if ((userChoice === 'Heads' && randomValue >= 0.5) || (userChoice === 'Tails' && randomValue < 0.5)) { + setTimeout(() => { + document.getElementById("toss").style.display = "none"; + document.getElementById("toss-res").style.display = "flex"; + }, 1500); + } else { + document.getElementById("toss-res-text").innerHTML = "

Oh!

You Lost the Toss

"; + + comp_toss_win_choice = Math.random(); + if (comp_toss_win_choice >= 0.5) { + document.getElementById("toss-choice-cont").innerHTML = "

Computer Has decided to Bat First

"; + } else { + document.getElementById("toss-choice-cont").innerHTML = "

Computer Has decided to Bowl First

"; + } + + setTimeout(() => { + document.getElementById("toss").style.display = "none"; + document.getElementById("toss-res").style.display = "flex"; + + setTimeout(() => { + gameStart(); + }, 1000); + + }, 1500); + } + }, 500); +} + +var scoreC = 0; // Score of comp +var scoreP = 0; // Score of Player +var flag = 1; // Indicator of Batsmen + +// Game +var sC = 0, SP = 0; +// Deciding Who Bats First + +function gameStart(UserInput = comp_toss_win_choice) { + if (UserInput === 2 || UserInput < 0.5) { // Player Bats first + bat_first(); + } + else if (UserInput === 3 || UserInput > 0.5) { // Player Bowls first + bowl_first(); + } + + document.getElementById("toss-res").style.display = "none"; + document.getElementById("game").style.display = "flex"; +} + +function showResult(){ + if (scoreC > scoreP) { + document.getElementById("out-title").innerHTML = "

Nice Try

But You Lost!

"; + document.getElementById("game").style.display = "none"; + document.getElementById("results").style.display = "flex"; + } + else if (scoreC === scoreP) { + document.getElementById("out-title").innerHTML = "

You played Well!

Game's Draw

"; + document.getElementById("game").style.display = "none"; + document.getElementById("results").style.display = "flex"; + } + else if (scoreC < scoreP) { + document.getElementById("game").style.display = "none"; + document.getElementById("results").style.display = "flex"; + } +} + +// Player Bats First... +function bat_first() { + run_1.addEventListener('click', function () { + if (flag === 1) plyBatFirst(1); + else if (flag === 2) plyBowlSecond(1); + else if(flag === 3) showResult(); + }) + run_2.addEventListener('click', function () { + if (flag === 1) plyBatFirst(2); + else if (flag === 2) plyBowlSecond(2); + else if(flag === 3) showResult(); + }) + run_3.addEventListener('click', function () { + if (flag === 1) plyBatFirst(3); + else if (flag === 2) plyBowlSecond(3); + else if(flag === 3) showResult(); + }) + run_4.addEventListener('click', function () { + if (flag === 1) plyBatFirst(4); + else if (flag === 2) plyBowlSecond(4); + else if(flag === 3) showResult(); + }) + run_5.addEventListener('click', function () { + if (flag === 1) plyBatFirst(5); + else if (flag === 2) plyBowlSecond(5); + else if(flag === 3) showResult(); + }) + run_6.addEventListener('click', function () { + if (flag === 1) plyBatFirst(6); + else if (flag === 2) plyBowlSecond(6); + else if(flag === 3) showResult(); + }) +} + +function plyBatFirst(plyChoice) { + const randomChoice = Math.round(Math.random() * 5 + 1); + // image generation + switch (randomChoice) { + case 1: + document.getElementsByClassName("comp-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("comp-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("comp-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("comp-i")[0].innerHTML = 'SIX'; + break; + } + // image generation + switch (plyChoice) { + case 1: + document.getElementsByClassName("ply-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("ply-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("ply-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("ply-i")[0].innerHTML = 'SIX'; + break; + } + + if (randomChoice === plyChoice) { + document.getElementsByClassName("status")[0].innerHTML = 'OUT'; + document.getElementById("Scr-P").innerHTML = scoreP; + SP = scoreP; + flag = 2; + } + else { + document.getElementsByClassName("status")[0].innerHTML = plyChoice; + scoreP += plyChoice; + document.getElementById("Scr-P").innerHTML = scoreP + '*'; + } +} + +function plyBowlSecond(plyChoice) { + const randomChoice = Math.round(Math.random() * 5 + 1); + // image generation + switch (randomChoice) { + case 1: + document.getElementsByClassName("comp-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("comp-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("comp-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("comp-i")[0].innerHTML = 'SIX'; + break; + } + // image generation + switch (plyChoice) { + case 1: + document.getElementsByClassName("ply-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("ply-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("ply-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("ply-i")[0].innerHTML = 'SIX'; + break; + } + + if (randomChoice === plyChoice) { + document.getElementsByClassName("status")[0].innerHTML = 'OUT'; + document.getElementById("Scr-C").innerHTML = scoreC; + sC = scoreC; + flag = 3; + } + else { + document.getElementsByClassName("status")[0].innerHTML = randomChoice; + scoreC += randomChoice; + document.getElementById("Scr-C").innerHTML = scoreC + '*'; + if(scoreC > scoreP) flag = 3; + } +} + + +// Player Bowls First... +function bowl_first() { + run_1.addEventListener('click', function () { + if (flag === 1) plyBowlFirst(1); + else if (flag === 2) plyBatSecond(1); + else if(flag === 3) showResult(); + }) + run_2.addEventListener('click', function () { + if (flag === 1) plyBowlFirst(2); + else if (flag === 2) plyBatSecond(2); + else if(flag === 3) showResult(); + }) + run_3.addEventListener('click', function () { + if (flag === 1) plyBowlFirst(3); + else if (flag === 2) plyBatSecond(3); + else if(flag === 3) showResult(); + }) + run_4.addEventListener('click', function () { + if (flag === 1) plyBowlFirst(4); + else if (flag === 2) plyBatSecond(4); + else if(flag === 3) showResult(); + }) + run_5.addEventListener('click', function () { + if (flag === 1) plyBowlFirst(5); + else if (flag === 2) plyBatSecond(5); + else if(flag === 3) showResult(); + }) + run_6.addEventListener('click', function () { + if (flag === 1) plyBowlFirst(6); + else if (flag === 2) plyBatSecond(6); + else if(flag === 3) showResult(); + }) +} + +function plyBowlFirst(plyChoice) { + const randomChoice = Math.round(Math.random() * 5 + 1); + // image generation + switch (randomChoice) { + case 1: + document.getElementsByClassName("comp-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("comp-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("comp-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("comp-i")[0].innerHTML = 'SIX'; + break; + } + // image generation + switch (plyChoice) { + case 1: + document.getElementsByClassName("ply-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("ply-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("ply-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("ply-i")[0].innerHTML = 'SIX'; + break; + } + + if (randomChoice === plyChoice) { + document.getElementsByClassName("status")[0].innerHTML = 'OUT'; + document.getElementById("Scr-C").innerHTML = scoreC; + sC = scoreC; + flag = 2; + } + + else { + document.getElementsByClassName("status")[0].innerHTML = randomChoice; + scoreC += randomChoice; + document.getElementById("Scr-C").innerHTML = scoreC + '*'; + } +} + +function plyBatSecond(plyChoice) { + const randomChoice = Math.round(Math.random() * 5 + 1); + // image generation + switch (randomChoice) { + case 1: + document.getElementsByClassName("comp-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("comp-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("comp-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("comp-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("comp-i")[0].innerHTML = 'SIX'; + break; + } + // image generation + switch (plyChoice) { + case 1: + document.getElementsByClassName("ply-i")[0].innerHTML = 'ONE'; + break; + + case 2: + document.getElementsByClassName("ply-i")[0].innerHTML = 'TWO'; + break; + + case 3: + document.getElementsByClassName("ply-i")[0].innerHTML = 'THREE'; + break; + + case 4: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FOUR'; + break; + + case 5: + document.getElementsByClassName("ply-i")[0].innerHTML = 'FIVE'; + break; + + case 6: + document.getElementsByClassName("ply-i")[0].innerHTML = 'SIX'; + break; + } + + if (randomChoice === plyChoice) { + document.getElementsByClassName("status")[0].innerHTML = 'OUT'; + document.getElementById("Scr-P").innerHTML = scoreP; + SP = scoreP; + flag = 3; + } + else { + document.getElementsByClassName("status")[0].innerHTML = plyChoice; + scoreP += plyChoice; + document.getElementById("Scr-P").innerHTML = scoreP + '*'; + if (scoreP > scoreC) { + flag = 3; + } + } +} + + +// Add event listener to the Play Again button +const playAgainBtn = document.querySelector('#playAgain .btn'); +playAgainBtn.addEventListener('click', playAgain); + +// Function to reset the game and show the landing page +function playAgain() { + // Reset game variables to initial values + location.reload(); +} diff --git a/SinglePlayer - Games/Hand_Cricket_Champ/style.css b/SinglePlayer - Games/Hand_Cricket_Champ/style.css new file mode 100644 index 00000000..4c00baad --- /dev/null +++ b/SinglePlayer - Games/Hand_Cricket_Champ/style.css @@ -0,0 +1,426 @@ +/* landing Page */ + + +@import url('https://fonts.googleapis.com/css2?family=Dosis:wght@200..800&display=swap'); + +*{ +margin: 0; +padding: 0; + +font-family: 'dosis'; +font-weight: 700; +} + +@media screen and (max-width: 750px){ + /*Instructions*/ + #Instructions .inst-container{ + height: 80%; + + background-color: white; + + border-radius: 70px; + + max-width: 800px; + margin: 0px 0px; + padding: 0px; + line-height: 23px !important; + } + + #Instructions .inst-container .heading { + font-size: 15px; + font-weight: bold; + margin-bottom: 0px; + } + #Instructions .inst-container .sub-heading { + font-size: 12px; + font-weight: bold; + margin-top: 0px; + margin-bottom: 0px; + } + #Instructions .inst-container .instruction { + margin-left: 0px; + font-size: 10px; + } + + /* Toss */ + #toss .coin-container #buttons{ + display: flex; + flex-direction: column; + gap: 10px; + + align-items: center; + } + + /* Game */ + #game .game-cont .score-cont{ + width: 90%; + padding: 0px 5px; + } + + #game .game-cont .score-cont .score{ + width: 125px; + height: 60%; + + font-size: 12px; + + } + + + /* game{ + height: 100vh; + width: 100vw; + background-color: rgba(14, 9, 41, 0.899); + + display: flex; + justify-content: center; + align-items: center; + } */ + + /* .game-cont{ + height: 80%; + width: 80%; + + border: 0px; + border-radius: 50px; + + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + background-color: white; + } */ + + #game .game-cont .graphic-cont{ + justify-content: space-evenly; + } + + #game .game-cont .status{ + height: 100%; + width: 15%; + font-weight: 800; + font-size: 32px; + + text-align: center; + } + + #game .game-cont .image img{ + width: 90%; + } + + #game .choice-cont{ + width: 90%; + + border: 0px; + border-radius: 40px; + + background-color: rgba(14, 9, 41, 0.899); + } + + #game .choice-cont .choice{ + height: 35px; + width: 35px; + + font-size: 30px; + font-weight: 800; + } + +} + +/* Landing Page */ + +#landing{ +height: 100vh; +width: 100vw; + +display: flex; +justify-content: center; +align-items: center; + +background-color: rgba(14, 9, 41, 0.899); +} + +#landing .cont{ +border: 0px; +border-radius: 70px; +width: 60%; +height: 80%; + +display: flex; +flex-direction: column; +align-items: center; +justify-content: center; + +gap: 40px; +padding: 40px; +text-align: center; + +background-color: white; +} + +.cont .title{ +display: flex; +flex-direction: column; +gap: 40px; +} + +/* Button design */ + +.btn{ +width: 150px; +height: 50px; + +border: 0px; +border-radius: 50px; +margin: 0 10px 10px 10px; + +background-color: rgba(14, 9, 41, 0.899); +color: rgb(255, 255, 255); +font-size: large; + +transition: all 0.3s ease; +} + +.btn:hover{ +width: 160px; +height: 60px; + +background-color: rgba(29, 22, 69, 0.723); +font-size: 24px; +} + +.btn a{ +text-decoration: none; +color: white; +font-weight: bolder; +color: white; + +} + +/* Instructions */ + +#Instructions{ + height: 100vh; + width: 100vw; + + display: flex; + justify-content: center; + align-items: center; + + background-color: rgba(14, 9, 41, 0.899); +} + +#Instructions .inst-container{ + height: 80%; + + background-color: white; + + border-radius: 70px; + + max-width: 800px; + margin: 0 auto; + padding: 20px; + line-height: 28px; +} + +.heading { + font-size: 24px; + font-weight: bold; + margin-bottom: 10px; +} +.sub-heading { + font-size: 18px; + font-weight: bold; + margin-top: 10px; + margin-bottom: 5px; +} +.instruction { + margin-left: 20px; +} + +/* Toss */ + +toss{ +display: flex; +justify-content: center; +align-items: center; +height: 100vh; +width: 100vw; +background-color: rgba(14, 9, 41, 0.899); +} + +.coin-container { +position: relative; + +background-color: white; +border: 0px; +border-radius: 70px; +width: 60%; +height: 80%; + +display: flex; +flex-direction: column; +gap: 20px; +justify-content: center; +align-items: center; +} + +.coin { +width: 100px; +height: 100px; +background-color: #ffd700; /* gold color */ +border-radius: 50%; +box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); +transform-style: preserve-3d; +transition: transform 0.5s ease-in-out; + +display: flex; +justify-content: center; +align-items: center; +color: aliceblue; +} + +#res{ +font-size: 48px; +} + +#toss-res{ + height: 100vh; + width: 100vw; + + background-color: rgba(14, 9, 41, 0.899); + display: flex; + align-items: center; + justify-content: center; +} + +.toss-res-cont{ + height: 80%; + width: 60%; + border: 0px; + border-radius: 70px; + + align-content: center; + text-align: center; + line-height:60px; + background-color: white; +} + +/* Game */ + +game{ + height: 100vh; + width: 100vw; + background-color: rgba(14, 9, 41, 0.899); + + display: flex; + justify-content: center; + align-items: center; +} + +.game-cont{ + height: 80%; + width: 80%; + + border: 0px; + border-radius: 50px; + + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + background-color: white; +} + +.game-cont .score-cont{ + height: 20%; + width: 80%; + + border: 0px; + border-radius: 50px; + + display: flex; + align-items: center; + justify-content: space-around; + + background-color: rgba(14, 9, 41, 0.899); +} + +.score-cont .score{ + height: 60%; + width: 150px; + background-color: aquamarine; + + border-radius: 20px; + + text-align: center; +} + +.graphic-cont{ + height: 50%; + width: 100%; + + display: flex; + justify-content: space-evenly; + align-items: center; +} + +.status{ + height: 100%; + width: 20%; + font-weight: 900; + font-size: 48px; + + text-align: center; +} + +.image img{ + width: 100%; +} + +.choice-cont{ + height: 20%; + width: 80%; + + border: 0px; + border-radius: 50px; + + display: flex; + justify-content: space-evenly; + align-items: center; + + background-color: rgba(14, 9, 41, 0.899); +} + +.choice{ + height: 50px; + width: 50px; + + border: 0px; + border-radius: 50%; + + background-color: white; + + text-align: center; + color: red; + font-size: 38px; + font-weight: 900; +} + + +/* Results */ + +.out-cont{ + width: 100vw; + height: 100vh; + + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + + gap: 20px; +} + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/README.md b/SinglePlayer - Games/Hangman Game play/Hangman Game/README.md new file mode 100644 index 00000000..f1db34b5 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/README.md @@ -0,0 +1,18 @@ +# guess-the-number-game +In this Hangman Game will guess the answer of given riddle in order to choose correct option and this game 6 chances to guess the letter +## Instructions +### Game Objective: + +- The computer will provide riddle and give 6 chance to guess the letter that present in answer. +- Your goal is to guess this answer letter within 6 attempts. +### How to Play: + +- The game will prompt you to enter your guess. +- After each guess, if letter correct then it will show on the frontend page and if it is not correct then the image will added with hangman image . +### Game Rules: + +- You have 6 attempts to guess the correct letter. +- The game will provide feedback after each letter to guide you towards the correct answer. +- If you guess the number within 6 attempts, you win. Otherwise, you lose the game. +### Screenshots: + \ No newline at end of file diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-0.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-0.svg new file mode 100644 index 00000000..4413c372 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-0.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-1.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-1.svg new file mode 100644 index 00000000..700cf117 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-1.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-2.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-2.svg new file mode 100644 index 00000000..780d93b5 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-2.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-3.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-3.svg new file mode 100644 index 00000000..f51cf848 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-3.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-4.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-4.svg new file mode 100644 index 00000000..1cc6ccfc --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-4.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-5.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-5.svg new file mode 100644 index 00000000..96158f99 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-5.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-6.svg b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-6.svg new file mode 100644 index 00000000..57d57212 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/hangman-6.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/lost.gif b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/lost.gif new file mode 100644 index 00000000..b29d9f12 Binary files /dev/null and b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/lost.gif differ diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/images/victory.gif b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/victory.gif new file mode 100644 index 00000000..e78a3475 Binary files /dev/null and b/SinglePlayer - Games/Hangman Game play/Hangman Game/images/victory.gif differ diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/index.html b/SinglePlayer - Games/Hangman Game play/Hangman Game/index.html new file mode 100644 index 00000000..c40df394 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/index.html @@ -0,0 +1,36 @@ + + + + + + Hangman Game using JavaScript by Damini Chachane + + + + + +
+
+ gif +

Game Over!

+

The correct word was: rainbow

+ +
+
+ +
+
+ hangman-img +

Hangman Game

+
+
+
    +

    Hint:

    +

    Incorrect guesses:

    +
    +
    +
    + + + + \ No newline at end of file diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/screenshot.webp b/SinglePlayer - Games/Hangman Game play/Hangman Game/screenshot.webp new file mode 100644 index 00000000..9b8427e6 Binary files /dev/null and b/SinglePlayer - Games/Hangman Game play/Hangman Game/screenshot.webp differ diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/script.js b/SinglePlayer - Games/Hangman Game play/Hangman Game/script.js new file mode 100644 index 00000000..9a90a26f --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/script.js @@ -0,0 +1,77 @@ +const wordDisplay = document.querySelector(".word-display"); +const guessesText = document.querySelector(".guesses-text b"); +const keyboardDiv = document.querySelector(".keyboard"); +const hangmanImage = document.querySelector(".hangman-box img"); +const gameModal = document.querySelector(".game-modal"); +const playAgainBtn = gameModal.querySelector("button"); +const themeToggle = document.getElementById('theme-toggle'); +const body = document.body; + + + +// Initializing game variables +let currentWord, correctLetters, wrongGuessCount; +const maxGuesses = 6; + +const resetGame = () => { + // Ressetting game variables and UI elements + correctLetters = []; + wrongGuessCount = 0; + hangmanImage.src = "images/hangman-0.svg"; + guessesText.innerText = `${wrongGuessCount} / ${maxGuesses}`; + wordDisplay.innerHTML = currentWord.split("").map(() => `
  • `).join(""); + keyboardDiv.querySelectorAll("button").forEach(btn => btn.disabled = false); + gameModal.classList.remove("show"); +} + +const getRandomWord = () => { + // Selecting a random word and hint from the wordList + const { word, hint } = wordList[Math.floor(Math.random() * wordList.length)]; + currentWord = word; // Making currentWord as random word + document.querySelector(".hint-text b").innerText = hint; + resetGame(); +} + +const gameOver = (isVictory) => { + // After game complete.. showing modal with relevant details + const modalText = isVictory ? `You found the word:` : 'The correct word was:'; + gameModal.querySelector("img").src = `images/${isVictory ? 'victory' : 'lost'}.gif`; + gameModal.querySelector("h4").innerText = isVictory ? 'Congrats!' : 'Game Over!'; + gameModal.querySelector("p").innerHTML = `${modalText} ${currentWord}`; + gameModal.classList.add("show"); +} + +const initGame = (button, clickedLetter) => { + // Checking if clickedLetter is exist on the currentWord + if(currentWord.includes(clickedLetter)) { + // Showing all correct letters on the word display + [...currentWord].forEach((letter, index) => { + if(letter === clickedLetter) { + correctLetters.push(letter); + wordDisplay.querySelectorAll("li")[index].innerText = letter; + wordDisplay.querySelectorAll("li")[index].classList.add("guessed"); + } + }); + } else { + // If clicked letter doesn't exist then update the wrongGuessCount and hangman image + wrongGuessCount++; + hangmanImage.src = `images/hangman-${wrongGuessCount}.svg`; + } + button.disabled = true; // Disabling the clicked button so user can't click again + guessesText.innerText = `${wrongGuessCount} / ${maxGuesses}`; + + // Calling gameOver function if any of these condition meets + if(wrongGuessCount === maxGuesses) return gameOver(false); + if(correctLetters.length === currentWord.length) return gameOver(true); +} + +// Creating keyboard buttons and adding event listeners +for (let i = 97; i <= 122; i++) { + const button = document.createElement("button"); + button.innerText = String.fromCharCode(i); + keyboardDiv.appendChild(button); + button.addEventListener("click", (e) => initGame(e.target, String.fromCharCode(i))); +} + +getRandomWord(); +playAgainBtn.addEventListener("click", getRandomWord); \ No newline at end of file diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/style.css b/SinglePlayer - Games/Hangman Game play/Hangman Game/style.css new file mode 100644 index 00000000..c69bfb07 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/style.css @@ -0,0 +1,188 @@ +/* Importing Google font - Open Sans */ +@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap"); +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: "Open Sans", sans-serif; +} +body { + display: flex; + padding: 0 10px; + align-items: center; + justify-content: center; + min-height: 100vh; + background: #73566a; +} +.container { + display: flex; + width: 850px; + gap: 70px; + padding: 60px 40px; + background: white; + border-radius: 10px; + align-items: flex-end; + justify-content: space-between; + box-shadow: 0 10px 20px rgba(0,0,0,0.9); +} +.hangman-box img { + user-select: none; + max-width: 270px; +} +.hangman-box h1 { + font-size: 1.45rem; + text-align: center; + margin-top: 20px; + text-transform: uppercase; + color: black; +} +.game-box .word-display { + gap: 10px; + list-style: none; + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; +} +.word-display .letter { + width: 28px; + font-size: 2rem; + text-align: center; + font-weight: 600; + margin-bottom: 40px; + text-transform: uppercase; + border-bottom: 3px solid black; +} +.word-display .letter.guessed { + margin: -40px 0 35px; + border-color: transparent; +} +.game-box h4 { + text-align: center; + font-size: 1.1rem; + font-weight: 500; + margin-bottom: 15px; +} +.game-box h4 b { + font-weight: 600; +} +.game-box .guesses-text b { + color: #ff0000; +} +.game-box .keyboard { + display: flex; + gap: 5px; + flex-wrap: wrap; + margin-top: 40px; + justify-content: center; +} +:where(.game-modal, .keyboard) button { + color: #fff; + border: none; + outline: none; + cursor: pointer; + font-size: 1rem; + font-weight: 600; + border-radius: 4px; + text-transform: uppercase; + background: #67078d; +} +.keyboard button { + padding: 7px; + width: calc(100% / 9 - 5px); +} +.keyboard button[disabled] { + pointer-events: none; + opacity: 0.6; +} +:where(.game-modal, .keyboard) button:hover { + background: #491549; +} +.game-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + pointer-events: none; + background: rgba(0,0,0,0.6); + display: flex; + align-items: center; + justify-content: center; + z-index: 9999; + padding: 0 10px; + transition: opacity 0.4s ease; +} +.game-modal.show { + opacity: 1; + pointer-events: auto; + transition: opacity 0.4s 0.4s ease; +} +.game-modal .content { + padding: 30px; + max-width: 420px; + width: 100%; + border-radius: 10px; + background: #fff; + text-align: center; + box-shadow: 0 10px 20px rgba(0,0,0,0.1); +} +.game-modal img { + max-width: 130px; + margin-bottom: 20px; +} +.game-modal img[src="images/victory.gif"] { + margin-left: -10px; +} +.game-modal h4 { + font-size: 1.53rem; +} +.game-modal p { + font-size: 1.15rem; + margin: 15px 0 30px; + font-weight: 500; +} +.game-modal p b { + color: #5E63BA; + font-weight: 600; +} +.game-modal button { + padding: 12px 23px; +} + +@media (max-width: 782px) { + .container { + flex-direction: column; + padding: 30px 15px; + align-items: center; + } + .hangman-box img { + max-width: 200px; + } + .hangman-box h1 { + display: none; + } + .game-box h4 { + font-size: 1rem; + } + .word-display .letter { + margin-bottom: 35px; + font-size: 1.7rem; + } + .word-display .letter.guessed { + margin: -35px 0 25px; + } + .game-modal img { + max-width: 120px; + } + .game-modal h4 { + font-size: 1.45rem; + } + .game-modal p { + font-size: 1.1rem; + } + .game-modal button { + padding: 10px 18px; + } +} \ No newline at end of file diff --git a/SinglePlayer - Games/Hangman Game play/Hangman Game/word-list.js b/SinglePlayer - Games/Hangman Game play/Hangman Game/word-list.js new file mode 100644 index 00000000..415f5601 --- /dev/null +++ b/SinglePlayer - Games/Hangman Game play/Hangman Game/word-list.js @@ -0,0 +1,262 @@ +const wordList = [ + { + word: "guitar", + hint: "A musical instrument with strings." + }, + { + word: "oxygen", + hint: "What gas is essential for most living organisms to breathe?" + }, + { + word: "elephant", + hint: "What is the largest land animal on Earth?" + }, + { + word: "apple", + hint: "What fruit is commonly associated with Newton's discovery of gravity?" + }, + { + word: "astronomy", + hint: "The scientific study of celestial objects and phenomena." + }, + { + word: "football", + hint: "A popular sport played with a spherical ball." + }, + { + word: "chocolate", + hint: "A sweet treat made from cocoa beans." + }, + { + word: "france", + hint:"European country is known for its iconic Eiffel Tower and Louvre Museum?" + }, + { + word: "saturn", + hint: " What is the sixth planet from the Sun in our solar system?" + }, + { + word: "pizza", + hint: "A savory dish consisting of a round, flattened base with toppings." + }, + { + word: "australia", + hint: "Which country is both a continent and an island?" + }, + { + word: "camera", + hint: "A device used to capture and record images or videos." + }, + { + word: "diamond", + hint: "A precious gemstone known for its brilliance and hardness." + }, + { + word: "mathematics", + hint: "What subject involves the study of numbers, quantities, shapes, and patterns?" + }, + { + word: "science", + hint: "The systematic study of the structure and behavior of the physical and natural world." + }, + { + word: "tokyo", + hint: "What is the capital city of Japan?" + }, + { + word: "mammal", + hint: "What type of creature is a dolphin?" + }, + { + word: "coffee", + hint: "A popular caffeinated beverage made from roasted coffee beans." + }, + { + word: "dance", + hint: "A rhythmic movement of the body often performed to music." + }, + { + word: "galaxy", + hint: "A vast system of stars, gas, and dust held together by gravity." + }, + { + word: "Everest", + hint: " What is the tallest mountain in the world?" + }, + { + word: "volcano", + hint: "A mountain or hill with a vent through which lava, rock fragments, hot vapor, and gas are ejected." + }, + { + word: "novel", + hint: "A long work of fiction, typically with a complex plot and characters." + }, + { + word: "pound", + hint: "What is the currency of the United Kingdom?" + }, + { + word: "Shakespeare", + hint: "Who wrote the play Romeo and Juliet ?" + }, + { + word: "iron", + hint: "What is the chemical element with the symbol Fe ?" + }, + { + word: "ballet", + hint: "A classical dance form characterized by precise and graceful movements." + }, + { + word: "astronaut", + hint: "A person trained to travel and work in space." + }, + { + word: "waterfall", + hint: "A cascade of water falling from a height." + }, + { + word: "technology", + hint: "The application of scientific knowledge for practical purposes." + }, + { + word: "rainbow", + hint: "A meteorological phenomenon that is caused by reflection, refraction, and dispersion of light." + }, + { + word: "universe", + hint: "All existing matter, space, and time as a whole." + }, + { + word: "piano", + hint: "A musical instrument played by pressing keys that cause hammers to strike strings." + }, + { + word: "vacation", + hint: "A period of time devoted to pleasure, rest, or relaxation." + }, + { + word: "rainforest", + hint: "A dense forest characterized by high rainfall and biodiversity." + }, + { + word: "theater", + hint: "A building or outdoor area in which plays, movies, or other performances are staged." + }, + { + word: "telephone", + hint: "A device used to transmit sound over long distances." + }, + { + word: "language", + hint: "A system of communication consisting of words, gestures, and syntax." + }, + { + word: "desert", + hint: "A barren or arid land with little or no precipitation." + }, + { + word: "sunflower", + hint: "A tall plant with a large yellow flower head." + }, + { + word: "fantasy", + hint: "A genre of imaginative fiction involving magic and supernatural elements." + }, + { + word: "telescope", + hint: "An optical instrument used to view distant objects in space." + }, + { + word: "breeze", + hint: "A gentle wind." + }, + { + word: "oasis", + hint: "A fertile spot in a desert where water is found." + }, + { + word: "photography", + hint: "The art, process, or practice of creating images by recording light or other electromagnetic radiation." + }, + { + word: "safari", + hint: "An expedition or journey, typically to observe wildlife in their natural habitat." + }, + { + word: "planet", + hint: "A celestial body that orbits a star and does not produce light of its own." + }, + { + word: "river", + hint: "A large natural stream of water flowing in a channel to the sea, a lake, or another such stream." + }, + { + word: "tropical", + hint: "Relating to or situated in the region between the Tropic of Cancer and the Tropic of Capricorn." + }, + { + word: "mysterious", + hint: "Difficult or impossible to understand, explain, or identify." + }, + { + word: "enigma", + hint: "Something that is mysterious, puzzling, or difficult to understand." + }, + { + word: "paradox", + hint: "A statement or situation that contradicts itself or defies intuition." + }, + { + word: "puzzle", + hint: "A game, toy, or problem designed to test ingenuity or knowledge." + }, + { + word: "whisper", + hint: "To speak very softly or quietly, often in a secretive manner." + }, + { + word: "shadow", + hint: "A dark area or shape produced by an object blocking the light." + }, + { + word: "secret", + hint: "Something kept hidden or unknown to others." + }, + { + word: "curiosity", + hint: "A strong desire to know or learn something." + }, + { + word: "unpredictable", + hint: "Not able to be foreseen or known beforehand; uncertain." + }, + { + word: "obfuscate", + hint: "To confuse or bewilder someone; to make something unclear or difficult to understand." + }, + { + word: "unveil", + hint: "To make known or reveal something previously secret or unknown." + }, + { + word: "illusion", + hint: "A false perception or belief; a deceptive appearance or impression." + }, + { + word: "moonlight", + hint: "The light from the moon." + }, + { + word: "vibrant", + hint: "Full of energy, brightness, and life." + }, + { + word: "nostalgia", + hint: "A sentimental longing or wistful affection for the past." + }, + { + word: "brilliant", + hint: "Exceptionally clever, talented, or impressive." + }, +]; \ No newline at end of file diff --git a/SinglePlayer - Games/SnakeBites/README.md b/SinglePlayer - Games/SnakeBites/README.md new file mode 100644 index 00000000..d522933d --- /dev/null +++ b/SinglePlayer - Games/SnakeBites/README.md @@ -0,0 +1,42 @@ +# **SnakeBites Game** + +--- + +
    + +## **Description ๐Ÿ“ƒ** +- This project is built on a basic web tech stacks such as HTML, CSS and Javascript. +- This game is just for fun. + +## **functionalities ๐ŸŽฎ** +- This game is a single player game. +- Using Up, Down, Left and Right Arrows, move the snake. +- By eating food, score will increase. +- High score will be updated when current score will be more than the high score. + +## ** Additional Features ** +- Displaying the current score and high score of the player. +- Implementing a graphical user interface (GUI) for a more interactive experience. +- Adding background sound and moving snake and eating food sounds. + +
    + +## **How to play? ๐Ÿ•น๏ธ** +- This is a single player game. +- Using Up, Down, Left and Right Arrows, move the snake in such a way it does not touch the boundaries and also not the snake body. +- If head of the snake smash into their body and the boundaries, will result into **"GAME OVER"** +- By eating the food, score will increase. + +
    + +## **Screenshots ๐Ÿ“ธ** + +
    + +![image](../SnakeBites/images/Snake-game.png) + +
    + +## **Working video ๐Ÿ“น** + + diff --git a/SinglePlayer - Games/SnakeBites/Snake_Bites.css b/SinglePlayer - Games/SnakeBites/Snake_Bites.css new file mode 100644 index 00000000..7e50f649 --- /dev/null +++ b/SinglePlayer - Games/SnakeBites/Snake_Bites.css @@ -0,0 +1,111 @@ +:root{ + --background: #d9d9d9; + --color: #ffc300; + --accent: #000814; + --shade: #001d3d; +} +*{ + padding: 0; + margin: 0; + box-sizing: border-box; + text-align: center; + font-family: 'Lato', sans-serif; +} +body{ + background-color:#fdf0d5; +} +.body{ + display: flex; + justify-content: center; + align-items: center; +} +img{ + position: fixed; + bottom: 0; + right: 0; + height:300px; + object-fit: cover; +} +h1{ + position: absolute; + top: 15px; + left: 20px; + font-size: 50px; + font-family: 'Rubik', sans-serif; + color: var(--accent); +} +#scoreBox{ + position: absolute; + top: 80px; + left: 20px; + font-size: 20px; +} +#hiscoreBox{ + position: absolute; + top: 80px; + left: 200px; + font-size: 20px; +} +#board{ + background: linear-gradient(var(--accent), #669bbc); + width: 90vmin; + height: 92vmin; + margin-top: 25px; + box-shadow: 0px 0px 10px 2px rgb(25, 26, 27) ; + display:grid; + grid-template-rows: repeat(18, 1fr); + grid-template-columns: repeat(18, 1fr); +} +.head{ + background: linear-gradient(#780000, #c1121f); + box-shadow: 0px 0px 5px 2px rgb(25, 26, 27) ; + border: 0.25vmin solid black; + border-radius: 9px; + transform:scale(1.02); + +} +.snake{ + background-color: #c1121f; + box-shadow: 0px 0px 5px 2px rgb(25, 26, 27) ; + border-radius: 12px; +} +.food{ + background: linear-gradient(#ee9b00, #e9d8a6); + border: 0.5vmin solid #e76f51; + border-radius: 8px; +} +.back{ + all: unset; + position:fixed; + top:25px; + right:30px; + background-color: var(--accent); + color: var(--color); + padding: 15px; + border-radius: 1rem; +} + +@media screen and (max-width:1000px) { + .body{ + flex-direction: column; + margin: 8% 0; + } + img{ + display: none; + } + h1{ + position: relative; + text-align: center; + } + #scoreBox{ + left: 5px; + } + #hiscoreBox{ + left:100px; + } + .back{ + top:70px; + right:25px; + font-size: 10px; + } +} \ No newline at end of file diff --git a/SinglePlayer - Games/SnakeBites/Snake_Bites.html b/SinglePlayer - Games/SnakeBites/Snake_Bites.html new file mode 100644 index 00000000..832b9f6d --- /dev/null +++ b/SinglePlayer - Games/SnakeBites/Snake_Bites.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + Snake-Bites + + + +
    +

    Snake Bites

    + + +
    +
    Score: 0
    +
    High Score: 0
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/SinglePlayer - Games/SnakeBites/Snake_Bites.js b/SinglePlayer - Games/SnakeBites/Snake_Bites.js new file mode 100644 index 00000000..c715b0bf --- /dev/null +++ b/SinglePlayer - Games/SnakeBites/Snake_Bites.js @@ -0,0 +1,141 @@ +// Game Constants & Variables +let inputDir = {x: 0, y: 0}; +const foodSound = new Audio('food.mp3'); +const gameOverSound = new Audio('gameover.mp3'); +const moveSound = new Audio('move.mp3'); +const musicSound = new Audio('music.mp3'); +let speed = prompt("Enter speed of the Snake you want: (5: easy, 10: medium, >15: hard)"); +let score = 0; +let lastPaintTime = 0; +let snakeArr = [ + {x: 13, y: 15} +]; + +food = {x: 6, y: 7}; + +// Game Functions +function main(ctime) { + window.requestAnimationFrame(main); + if((ctime - lastPaintTime)/1000 < 1/speed){ + return; + } + musicSound.play(); + lastPaintTime = ctime; + gameEngine(); +} + +function isCollide(snake) { + // If you bump into yourself + for (let i = 1; i < snakeArr.length; i++) { + if(snake[i].x === snake[0].x && snake[i].y === snake[0].y){ + return true; + } + } + // If you bump into the wall + if(snake[0].x >= 18 || snake[0].x <=0 || snake[0].y >= 18 || snake[0].y <=0){ + return true; + } + + return false; +} + +function gameEngine(){ + // Part 1: Updating the snake array & Food + if(isCollide(snakeArr)){ + gameOverSound.play(); + musicSound.pause(); + inputDir = {x: 0, y: 0}; + alert("Game Over. Press any key to play again!"); + snakeArr = [{x: 13, y: 15}]; + score = 0; + } + + // If you have eaten the food, increment the score and regenerate the food + if(snakeArr[0].y === food.y && snakeArr[0].x ===food.x){ + foodSound.play(); + score += 1; + if(score>hiscoreval){ + hiscoreval = score; + localStorage.setItem("hiscore", JSON.stringify(hiscoreval)); + hiscoreBox.innerHTML = "HiScore: " + hiscoreval; + } + scoreBox.innerHTML = "Score: " + score; + snakeArr.unshift({x: snakeArr[0].x + inputDir.x, y: snakeArr[0].y + inputDir.y}); + let a = 2; + let b = 16; + food = {x: Math.round(a + (b-a)* Math.random()), y: Math.round(a + (b-a)* Math.random())} + } + + // Moving the snake + for (let i = snakeArr.length - 2; i>=0; i--) { + snakeArr[i+1] = {...snakeArr[i]}; + } + + snakeArr[0].x += inputDir.x; + snakeArr[0].y += inputDir.y; + + // Part 2: Display the snake and Food + // Display the snake + board.innerHTML = ""; + snakeArr.forEach((e, index)=>{ + snakeElement = document.createElement('div'); + snakeElement.style.gridRowStart = e.y; + snakeElement.style.gridColumnStart = e.x; + + if(index === 0){ + snakeElement.classList.add('head'); + } + else{ + snakeElement.classList.add('snake'); + } + board.appendChild(snakeElement); + }); + // Display the food + foodElement = document.createElement('div'); + foodElement.style.gridRowStart = food.y; + foodElement.style.gridColumnStart = food.x; + foodElement.classList.add('food') + board.appendChild(foodElement); +} + +// Main logic starts here +musicSound.play(); +let hiscore = localStorage.getItem("hiscore"); +if(hiscore === null){ + hiscoreval = 0; + localStorage.setItem("hiscore", JSON.stringify(hiscoreval)) +} +else{ + hiscoreval = JSON.parse(hiscore); + hiscoreBox.innerHTML = "HiScore: " + hiscore; +} + +window.requestAnimationFrame(main); +window.addEventListener('keydown', e =>{ + inputDir = {x: 0, y: 1} // Start the game + moveSound.play(); + switch (e.key) { + case "ArrowUp": + inputDir.x = 0; + inputDir.y = -1; + break; + + case "ArrowDown": + inputDir.x = 0; + inputDir.y = 1; + break; + + case "ArrowLeft": + inputDir.x = -1; + inputDir.y = 0; + break; + + case "ArrowRight": + inputDir.x = 1; + inputDir.y = 0; + break; + default: + break; + } + +}); \ No newline at end of file diff --git a/SinglePlayer - Games/SnakeBites/food.mp3 b/SinglePlayer - Games/SnakeBites/food.mp3 new file mode 100644 index 00000000..076198c9 Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/food.mp3 differ diff --git a/SinglePlayer - Games/SnakeBites/gameover.mp3 b/SinglePlayer - Games/SnakeBites/gameover.mp3 new file mode 100644 index 00000000..414bf651 Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/gameover.mp3 differ diff --git a/SinglePlayer - Games/SnakeBites/images/Snake-game.png b/SinglePlayer - Games/SnakeBites/images/Snake-game.png new file mode 100644 index 00000000..e93bab58 Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/images/Snake-game.png differ diff --git a/SinglePlayer - Games/SnakeBites/images/logo.jpeg b/SinglePlayer - Games/SnakeBites/images/logo.jpeg new file mode 100644 index 00000000..3b86b8c0 Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/images/logo.jpeg differ diff --git a/SinglePlayer - Games/SnakeBites/images/snake.gif b/SinglePlayer - Games/SnakeBites/images/snake.gif new file mode 100644 index 00000000..44d0e7b9 Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/images/snake.gif differ diff --git a/SinglePlayer - Games/SnakeBites/move.mp3 b/SinglePlayer - Games/SnakeBites/move.mp3 new file mode 100644 index 00000000..4d3d245d Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/move.mp3 differ diff --git a/SinglePlayer - Games/SnakeBites/music.mp3 b/SinglePlayer - Games/SnakeBites/music.mp3 new file mode 100644 index 00000000..f1507af3 Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/music.mp3 differ diff --git a/SinglePlayer - Games/SnakeBites/snakebites.mp4 b/SinglePlayer - Games/SnakeBites/snakebites.mp4 new file mode 100644 index 00000000..4432a24f Binary files /dev/null and b/SinglePlayer - Games/SnakeBites/snakebites.mp4 differ diff --git a/SinglePlayer - Games/rock-paper-scissor/paper.png b/SinglePlayer - Games/rock-paper-scissor/paper.png new file mode 100644 index 00000000..fcc66033 Binary files /dev/null and b/SinglePlayer - Games/rock-paper-scissor/paper.png differ diff --git a/SinglePlayer - Games/rock-paper-scissor/rock.png b/SinglePlayer - Games/rock-paper-scissor/rock.png new file mode 100644 index 00000000..9bd0b7ae Binary files /dev/null and b/SinglePlayer - Games/rock-paper-scissor/rock.png differ diff --git a/SinglePlayer - Games/rock-paper-scissor/rps.css b/SinglePlayer - Games/rock-paper-scissor/rps.css new file mode 100644 index 00000000..d34442da --- /dev/null +++ b/SinglePlayer - Games/rock-paper-scissor/rps.css @@ -0,0 +1,54 @@ +* { + margin: 0; + padding: 0; + font-family: Arial, Helvetica, sans-serif; + text-align: center; +} +h1 { + background-color: #081b31; + padding-top: 1rem; + text-align: center; + height: 5rem; +} +.choices { + display: flex; + justify-content: center; + align-items: center; +} +.choice img:hover { + cursor: pointer; + border: 0.5rem #081b31 solid; +} +.choice img { + margin-left: 1rem; + margin-right: 1rem; + height: 120px; + width: 120px; + object-fit: cover; + border-radius: 50%; +} +.score-board{ + display: flex; + justify-content: center; + align-items: center; + font-size: 2rem; + margin-top: 4rem; +} +.score-board p{ + margin-left: 2rem; + margin-right: 2rem; +} +#user-score,#comp-score{ + font-size: 3rem; +} +.msg-container{ + margin-top: 2rem; +} +#msg{ + font-size: 1.5rem; + display: inline; + background-color: #081b31; + color: #fff; + padding: 1rem; + border-radius: 5rem; +} \ No newline at end of file diff --git a/SinglePlayer - Games/rock-paper-scissor/rps.html b/SinglePlayer - Games/rock-paper-scissor/rps.html new file mode 100644 index 00000000..5d6b0956 --- /dev/null +++ b/SinglePlayer - Games/rock-paper-scissor/rps.html @@ -0,0 +1,39 @@ + + + + + + Rock paper scissors + + + + + + +

    Rock Paper Scissors

    +
    +
    + rock +
    +
    + paper +
    +
    + scissors +
    +
    +
    +
    +

    0

    +

    You

    +
    +
    +

    0

    +

    Computer

    +
    +
    +
    +

    Play your move

    +
    + + diff --git a/SinglePlayer - Games/rock-paper-scissor/rps.js b/SinglePlayer - Games/rock-paper-scissor/rps.js new file mode 100644 index 00000000..e29e8742 --- /dev/null +++ b/SinglePlayer - Games/rock-paper-scissor/rps.js @@ -0,0 +1,92 @@ +let userScore = 0; +let compScore = 0; + +let msg=document.querySelector("#msg"); +let user=document.querySelector("#user-score"); +let comp=document.querySelector("#comp-score"); + +const genComputerChoice =() =>{ + const options = ["rock","paper","scissors"]; + const randIdx = Math.floor(Math.random()*3); + return options[randIdx]; +} + +const drawGame = () =>{ + console.log("The game was a draw"); +} +const playGame = (userChoice) =>{ + console.log("user choice = ",userChoice); + const compChoice = genComputerChoice(); + console.log("computer choice = ",compChoice); + if(userChoice===compChoice){ + drawGame(); + msg.innerHTML="The game was a draw"; + } + else{ + let userWin=true; + if(userChoice==="rock"){ + userWin = compChoice === "paper" ? false : true; + console.log(userWin); + if(userWin===false){ + compScore++; + msg.innerHTML="Better luck next time!"; + msg.style.backgroundColor = "red"; + user.innerHTML=userScore; + comp.innerHTML=compScore; + } + else{ + userScore++; + msg.innerHTML="Yayy! You won"; + msg.style.backgroundColor = "green"; + user.innerHTML=userScore; + comp.innerHTML=compScore; + } + } + else if(userChoice==="paper"){ + userWin = compChoice === "rock" ? true : false; + console.log(userWin); + if(userWin===false){ + compScore++; + msg.innerHTML="Better luck next time!"; + msg.style.backgroundColor = "red"; + user.innerHTML=userScore; + comp.innerHTML=compScore; + } + else{ + userScore++; + msg.innerHTML="Yayy! You won"; + msg.style.backgroundColor = "green"; + user.innerHTML=userScore; + comp.innerHTML=compScore; + } + } + else{ + userWin = compChoice === "paper" ? true : false; + console.log(userWin); + if(userWin===false){ + compScore++; + msg.innerHTML="Better luck next time!"; + msg.style.backgroundColor = "red"; + user.innerHTML=userScore; + comp.innerHTML=compScore; + } + else{ + userScore++; + msg.innerHTML="Yayy! You won"; + msg.style.backgroundColor = "green"; + user.innerHTML=userScore; + comp.innerHTML=compScore; + } + } + } +} + +const choices = document.querySelectorAll(".choice"); +choices.forEach((choice)=>{ + console.log(choice); + choice.addEventListener("click", ()=>{ + const userChoice=choice.getAttribute("id"); + console.log("choice was clicked ",userChoice); + playGame(userChoice); + }) +}) \ No newline at end of file diff --git a/SinglePlayer - Games/rock-paper-scissor/scissors.png b/SinglePlayer - Games/rock-paper-scissor/scissors.png new file mode 100644 index 00000000..c9dcbb6c Binary files /dev/null and b/SinglePlayer - Games/rock-paper-scissor/scissors.png differ diff --git a/SinglePlayer - Games/simon-says/script.js b/SinglePlayer - Games/simon-says/script.js index 7c21822b..786005d4 100644 --- a/SinglePlayer - Games/simon-says/script.js +++ b/SinglePlayer - Games/simon-says/script.js @@ -117,6 +117,7 @@ class Simon { this.errorSound.play(); this.display.startButton.disabled = false; this.blockedButtons = true; + round.innerHTML=`You Lost.
    Your score : ${this.round}`; } @@ -126,7 +127,7 @@ class Simon { this.buttons.forEach(element =>{ element.classList.add('winner'); }); - this.updateRound('you win ๐Ÿ†'); + round.innerHTML=`You Win ๐Ÿ†
    Your score : ${this.round}`; } } diff --git a/SinglePlayer - Games/simon-says/styles.css b/SinglePlayer - Games/simon-says/styles.css index 9e35834f..6a8bb6f9 100644 --- a/SinglePlayer - Games/simon-says/styles.css +++ b/SinglePlayer - Games/simon-says/styles.css @@ -15,6 +15,12 @@ margin-top: 50px; padding: 10px; border-radius: 5px; + width:500px; +} + +#round{ + position:relative; + left:100px; } .buttonContainer { @@ -22,6 +28,7 @@ grid-gap: 10px; grid-template-columns: auto auto; transform: rotate(45deg); + margin-left:25%; } .square { diff --git a/SinglePlayer - Games/word_guessing_game/index.html b/SinglePlayer - Games/word_guessing_game/index.html new file mode 100644 index 00000000..f5cd18f0 --- /dev/null +++ b/SinglePlayer - Games/word_guessing_game/index.html @@ -0,0 +1,24 @@ + + + + + + Word Guessing Game + + + +
    +
    +

    Word Guessing Game

    +
    +

    Enter a letter:

    + + + +

    +

    +
    Attempts left:
    +
    + + + diff --git a/SinglePlayer - Games/word_guessing_game/script.js b/SinglePlayer - Games/word_guessing_game/script.js new file mode 100644 index 00000000..66917a81 --- /dev/null +++ b/SinglePlayer - Games/word_guessing_game/script.js @@ -0,0 +1,101 @@ +document.addEventListener("DOMContentLoaded", function() { + const words = [ + { word: "javascript", hint: "I am a programming language commonly used for web development." }, + { word: "programming", hint: "I involve writing instructions for computers to execute." }, + { word: "html", hint: "I am the standard markup language for creating web pages." }, + { word: "css", hint: "I am used for styling web pages and making them look attractive." }, + { word: "developer", hint: "I am someone who creates software applications or websites." }, + { word: "coding", hint: "I am the process of writing instructions for a computer to execute." }, + { word: "algorithm", hint: "I am a set of rules or steps for solving a problem." }, + { word: "function", hint: "I am a block of reusable code that performs a specific task." }, + { word: "variable", hint: "I am a container for storing data values." }, + { word: "loop", hint: "I am a programming construct used to repeat a block of code." } + ]; + + let randomWord; + let guessedLetters = []; + let remainingAttempts; + + function initGame() { + // Select a random word from the words array + const randomIndex = Math.floor(Math.random() * words.length); + randomWord = words[randomIndex].word; + const hint = words[randomIndex].hint; + + // Display placeholders for each letter in the word + const wordContainer = document.getElementById("word-container"); + wordContainer.innerHTML = ""; + for (let i = 0; i < randomWord.length; i++) { + const letterContainer = document.createElement("span"); + letterContainer.textContent = "_"; + letterContainer.className = "letter"; + wordContainer.appendChild(letterContainer); + } + + // Reset guessed letters and remaining attempts + guessedLetters = []; + remainingAttempts = 6; + document.getElementById("hint").textContent = hint; + document.getElementById("attempts-left").textContent = remainingAttempts; + document.getElementById("result").textContent = ""; + } + + function checkLetter(letter) { + if (guessedLetters.includes(letter)) { + return; // Already guessed this letter + } + + guessedLetters.push(letter); + + const wordContainer = document.getElementById("word-container"); + let correctGuess = false; + + // Check if the letter exists in the word + for (let i = 0; i < randomWord.length; i++) { + if (randomWord[i] === letter) { + wordContainer.children[i].textContent = letter; + correctGuess = true; + } + } + + // Update remaining attempts and check for win or loss + if (!correctGuess) { + remainingAttempts--; + updateResult(); + } else { + if (wordContainer.textContent === randomWord) { + document.getElementById("result").textContent = "Congratulations! You guessed the word."; + } + } + + document.getElementById("attempts-left").textContent = remainingAttempts; + } + + function updateResult() { + if (remainingAttempts === 0) { + document.getElementById("result").textContent = "Sorry, you've run out of attempts. The word was: " + randomWord + "."; + } + } + + // Initialize the game when the page loads + initGame(); + + // Event listener for the guess button + document.getElementById("guess-button").addEventListener("click", function() { + const letterInput = document.getElementById("letter-input").value.trim().toLowerCase(); + + if (letterInput.length !== 1 || !/^[a-z]+$/.test(letterInput)) { + alert("Please enter a single letter from A to Z."); + return; + } + + checkLetter(letterInput); + document.getElementById("letter-input").value = ""; + }); + + // Event listener for the hint button + document.getElementById("hint-button").addEventListener("click", function() { + const hintContainer = document.getElementById("hint"); + hintContainer.style.display = "block"; + }); +}); diff --git a/SinglePlayer - Games/word_guessing_game/styles.css b/SinglePlayer - Games/word_guessing_game/styles.css new file mode 100644 index 00000000..14aca7a6 --- /dev/null +++ b/SinglePlayer - Games/word_guessing_game/styles.css @@ -0,0 +1,124 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + overflow: hidden; +} + +.background { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(to right, #ff2e63, #ff9a2e, #ffcb2e, #76ff2e, #2effff); + background-size: 1000% 1000%; + animation: gradientAnimation 10s ease infinite; +} + +@keyframes gradientAnimation { + 0% {background-position: 0% 50%;} + 50% {background-position: 100% 50%;} + 100% {background-position: 0% 50%;} +} + +#game-container { + position: relative; + z-index: 1; + max-width: 400px; + text-align: center; + padding: 20px; + background-color: rgba(255, 255, 255, 0.8); /* Add transparency for better contrast */ + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +h1 { + color: #333; + margin-bottom: 20px; +} + +#word-container { + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 20px; + font-size: 24px; +} + +.letter { + width: 30px; + height: 30px; + background-color: #ccc; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + margin: 0 5px; +} + +#letter-input { + padding: 10px; + margin-bottom: 10px; + width: calc(100% - 40px); + border: 1px solid #ccc; + border-radius: 5px; +} + +#guess-button, #hint-button { + padding: 10px 20px; + border: none; + border-radius: 5px; + cursor: pointer; + background-color: #007bff; + color: #fff; + transition: background-color 0.3s; +} + +#guess-button:hover, #hint-button:hover { + background-color: #0056b3; +} + +#result { + margin-top: 20px; + font-weight: bold; + color: #333; +} + +#attempts { + font-size: 18px; + margin-top: 20px; +} + +#hint { + display: none; + margin-top: 20px; + color: #333; +} + +.show-hint { + display: block; +} +#game-container { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 1; + max-width: 400px; + text-align: center; + padding: 20px; + background-color: rgba(255, 255, 255, 0.8); /* Add transparency for better contrast */ + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +#hint { + display: none; + margin-top: 20px; + color: #333; +} + +.show-hint { + display: block; +} diff --git a/additionalpage/contact.html b/additionalpage/contact.html index bc6c82cb..249884ad 100644 --- a/additionalpage/contact.html +++ b/additionalpage/contact.html @@ -21,7 +21,7 @@ - + contact @@ -77,30 +77,49 @@

    Contact Us

    + +
    Have You Any Questions?
    +

    Contact us at ...

    - -

    Call Us

    -

    xxxxxxxxxxx

    + + + Discord +
    - -

    Office

    -

    xxxxxxxxxxx

    + + + + Linkedin + +
    - -

    Email

    -

    xxxxxxxxxxx

    + + + + + Github + +
    - -

    Website

    -

    xxxxxxxxxxx

    + + + Facebook + + + +
    @@ -109,12 +128,17 @@

    Send Us An Email

    - - +
    + + +
    +
    - - +
    + + +
    @@ -127,20 +151,25 @@

    Send Us An Email

    -
    - - - +
    +
    + + + +
    +
    -
    - - - -
    - -
    @@ -159,10 +188,10 @@

    Send Us An Email

    diff --git a/additionalpage/game.html b/additionalpage/game.html index 76d3ce59..8ca00cac 100644 --- a/additionalpage/game.html +++ b/additionalpage/game.html @@ -190,6 +190,60 @@

    2048 Games

    + + + + +
    +
    + +
    + 45 + +
    +
    +
    + +
    +
    +

    DoraemonRun

    +

    Doraemon Run is an adventurous maze-navigation game where players guide Doraemon through obstacles, collect cakes, and avoid traps while managing score and health to prevent game over. + +

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    28.05.2023

    +
    +
    +

    Updated:  

    +

    Action | Desktop

    +
    +
    +
    + Play Now +
    +
    +
    +
    + + @@ -604,6 +658,59 @@

    Anti Virus

    + + + + + + +
    +
    + +
    + 45 + +
    +
    +
    + +
    +
    +

    SnakeBites

    +

    Snakebites is an exciting, fast-paced arcade game where players navigate a growing snake to consume food while avoiding obstacles. Test your reflexes and strategy as you aim for high scores and unlock new levels.

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    28.05.2023

    +
    +
    +

    Updated:  

    +

    Action | Desktop

    +
    +
    +
    + Play Now +
    +
    +
    +
    + @@ -2553,6 +2660,58 @@

    Guess The Number

    + + + + + +
    +
    + +
    + 41 + +
    +
    +
    + +
    +
    +

    Guess The Number

    +

    Attempt to logically guess the a random secret sequence of colours

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    27.05.2024

    +
    +
    +

    Updated:  

    +

    Puzzle | Desktop

    +
    +
    +
    + Play Now +
    +
    +
    +
    + @@ -5087,6 +5246,59 @@

    Tetris

    + + + + +
    +
    + +
    + 241 + +
    +
    +
    + +
    +
    +

    Rock paper scissors

    +

    Experience the timeless puzzle sensation of "rock papaer scissors"

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    07.12.2015

    +
    +
    +

    Updated:  

    +

    Action | Desktop

    +
    +
    +
    + play now +
    +
    +
    +
    + + + @@ -8798,6 +9010,58 @@

    Shadow_Poke_Guessing_Game

    +
    +
    + + +
    + 45 + +
    +
    +
    + + +
    +
    +

    Hand_Cricket_Champ

    +

    Cricket at your Fingertips!

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    21.05.2024

    +
    +
    +

    Updated:  

    +

    Casual | Desktop/Mobile

    +
    +
    +
    + Play Now +
    +
    +
    +
    + + @@ -9202,6 +9466,59 @@

    2048 Games

    + + + + + +
    +
    + +
    + 41 + +
    +
    +
    + +
    +
    +

    General Knowledge Quiz

    +

    Are you ready to put your programming knowledge to the test? Whether you're a seasoned developer or just starting your coding journey, a General Knowledge Quiz for programmers can be both fun and educational.

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    22.05.2024

    +
    +
    +

    Updated:  

    +

    Action | Desktop

    +
    +
    +
    + Play Now +
    +
    +
    +
    + + diff --git a/additionalpage/multiplayer.html b/additionalpage/multiplayer.html index 19c37868..31083858 100644 --- a/additionalpage/multiplayer.html +++ b/additionalpage/multiplayer.html @@ -186,6 +186,47 @@

    Guess Flag

    + +
    +
    + +
    + 41 + +
    +
    +
    +
    +
    +

    Pop My Balloon

    +

    Pop My Balloon is a game in which you have to guess a number avoiding the lucky number otherwise the balloon will pop.

    +
    +
    + + + + + +
    +
    +
    +
    +
    +

    Release Date:  

    +

    18.05.2024

    +
    +
    +

    Updated:  

    +

    Action | Desktop

    +
    +
    +
    + Play Now +
    +
    +
    +
    + diff --git a/assets/images/GKQuiz.png b/assets/images/GKQuiz.png new file mode 100644 index 00000000..6e273952 Binary files /dev/null and b/assets/images/GKQuiz.png differ diff --git a/assets/images/Pop_My_Balloon.png b/assets/images/Pop_My_Balloon.png new file mode 100644 index 00000000..f69862c8 Binary files /dev/null and b/assets/images/Pop_My_Balloon.png differ diff --git a/assets/images/Snake-game.png b/assets/images/Snake-game.png new file mode 100644 index 00000000..e93bab58 Binary files /dev/null and b/assets/images/Snake-game.png differ diff --git a/assets/images/people-playing-paper-rock-scissors-royalty-free-illustration-1583269312.jpg b/assets/images/people-playing-paper-rock-scissors-royalty-free-illustration-1583269312.jpg new file mode 100644 index 00000000..fbd396ce Binary files /dev/null and b/assets/images/people-playing-paper-rock-scissors-royalty-free-illustration-1583269312.jpg differ diff --git a/dist/color-theme.css b/dist/color-theme.css index 94c7e007..6525d75f 100644 --- a/dist/color-theme.css +++ b/dist/color-theme.css @@ -1,116 +1,106 @@ +.display { + display: none; +} +.theam-div { + display: flex; + position: fixed; + justify-content: center; + /* align-items: center; */ + top: 65px; + right: 10px; + padding: 10px; + gap: 10px; + transition: all 0.4s ease; + color: black; +} -.display{ - display: none; - } - - .theam-div{ - display: flex; - position: fixed; - justify-content: center; - /* align-items: center; */ - top: 50px; - right: 10px; - padding: 10px; - gap: 10px; - transition: all 0.4s ease; - color: black; - } - - - .button-part{ - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - margin-right: 10px; - /* padding: 10px; +.button-part { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + margin-right: 5px; + /* padding: 10px; background-color: var(--bg-black-1000); border-radius: 5px; */ - } - - .button-part i{ - cursor: pointer; - - color: black - /* margin-bottom: 10px; */ - } - - - .dark-light{ - background-color: white; - - width: 30px; - height: 30px; - display: flex; - justify-content: center; - align-items: center; - - text-align: center; - border-radius: 50%; - /* margin-top: 5px; */ - cursor: pointer; - - } - .setting{ - - background-color: white; - - width: 30px; - height: 30px; - display: flex; - justify-content: center; - align-items: center; - - text-align: center; - border-radius: 50%; - margin-top: -38px; - cursor: pointer; - } - - .theams{ - padding: 10px; - background-color: white; - border-radius: 5px; - } - .theme-buttons{ - display: flex; - - } - - .theme-buttons div{ - width: 25px; - height: 25px; - /* border: 2px solid var(--bg-black-1200); */ - border-radius: 50%; - margin-right: 5px; - margin-top: 5px; - cursor: pointer; - - } - - .red{ - background-color:#E90064; - } - - .blue{ - background-color: rgb(0 159 157 ); - } - - - .pink{ - background-color: #FF55BB; - } - - .green{ - background-color: #127C56; - } - - .purple{ - background-color: #B799FF; - } - - .open{ - transform: translateX(190px); - - } \ No newline at end of file +} + +.button-part i { + cursor: pointer; + + color: black; + /* margin-bottom: 10px; */ +} + +.dark-light { + background-color: white; + + width: 30px; + height: 30px; + display: flex; + justify-content: center; + align-items: center; + + text-align: center; + border-radius: 50%; + /* margin-top: 5px; */ + cursor: pointer; +} +.setting { + background-color: white; + + width: 30px; + height: 30px; + display: flex; + justify-content: center; + align-items: center; + + text-align: center; + border-radius: 50%; + margin-top: -38px; + cursor: pointer; +} + +.theams { + padding: 10px; + background-color: white; + border-radius: 5px; +} +.theme-buttons { + display: flex; +} + +.theme-buttons div { + width: 25px; + height: 25px; + /* border: 2px solid var(--bg-black-1200); */ + border-radius: 50%; + margin-right: 5px; + margin-top: 5px; + cursor: pointer; +} + +.red { + background-color: #e90064; +} + +.blue { + background-color: rgb(0 159 157); +} + +.pink { + background-color: #ff55bb; +} + +.green { + background-color: #127c56; +} + +.purple { + background-color: #b799ff; +} + +.open { + transform: translateX(190px); +} diff --git a/dist/contact.css b/dist/contact.css index 77fafe96..65b0145f 100644 --- a/dist/contact.css +++ b/dist/contact.css @@ -10,6 +10,31 @@ justify-content: center; align-items: center; } +.inputDiv{ + position: relative; +} +.inDiv{ + position: relative; +} +.icon1{ + position: absolute; + top:calc(15%); + left:1.8%; +} +.icon2{ + position: absolute; + top:calc(15%); + left:2.0%; + +} +.icon3{ + position: absolute; + top:calc(18%); + left:1.6%; +} +.contact-form input{ + border:2px solid var(--main-color); +} .main-div{ width: 100%; /* background-color: rgb(16 14 43 );; */ @@ -67,16 +92,24 @@ color: var(--main-color); } -.icon-div h3{ +.icon-div a{ color: white; font-weight: bold; + margin-top: 5px; margin: 10px; } +.icon-div a:hover{ + color: cyan; + font-weight: 400; +} .icon-div p{ color: rgb(224, 224, 224); } - +.color{ + margin-top: 20px; + font-size: 1.2vw; +} .form-above-heading{ color: var(--main-color); text-align: center; diff --git a/index.html b/index.html index 83d1759b..74075019 100644 --- a/index.html +++ b/index.html @@ -60,10 +60,11 @@ + -
    +