Skip to content

Commit

Permalink
Merge branch 'main' into tetris
Browse files Browse the repository at this point in the history
  • Loading branch information
ishita-43 authored Jul 21, 2024
2 parents 252be9f + 2d2244e commit 554a56b
Show file tree
Hide file tree
Showing 14 changed files with 514 additions and 383 deletions.
65 changes: 65 additions & 0 deletions Games/Angry_Bird/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Angry Birds

## Overview

The Angry Birds is a user-friendly browser extension designed to enhance your Angry Birds gaming experience. This script allows you to modify in-game resources and unlock features with ease. The functionalities include modifying coins, unlocking all levels, and unlocking all birds, providing you with unlimited access to the game’s content.

## Features

### Modify Coins
- **Description**: Change your current coin count to a specified amount.
- **Usage**: Input your current number of coins, and the script will set the coin count to a high value (e.g., 999,999).

### Unlock All Levels
- **Description**: Instantly unlock all levels in the game.
- **Usage**: Allows access to play any level without needing to progress sequentially.

### Unlock All Birds
- **Description**: Unlock all bird characters in the game.
- **Usage**: Provides access to every bird with unique abilities from the start.

## Installation

1. Clone or download the repository.
2. Open your browser and navigate to the extensions page.
3. Enable "Developer mode".
4. Click "Load unpacked" and select the directory containing the downloaded files.

## Usage

1. Open the extension by clicking on the Angry Birds GG Script icon in your browser.
2. Choose the desired option:
- **Modify Coins**: Enter your current amount of coins when prompted.
- **Unlock All Levels**: Click to unlock all levels instantly.
- **Unlock All Birds**: Click to unlock all birds instantly.
3. Follow the prompts and alerts to complete the modifications.

## Files

### `index.html`

The HTML file providing the structure of the user interface.

### `styles.css`

The CSS file for styling the user interface.

### `script.js`

The JavaScript file containing the functionality for modifying the game’s resources.

### `manifest.json`

The manifest file required for the browser extension, specifying metadata and permissions.

## Contributing

Contributions are welcome! Please feel free to submit a pull request.

## License

This project is for educational purposes only. Use at your own risk.

---

By using this script, you acknowledge that it is for educational purposes only and should not be used to cheat in the game.
17 changes: 17 additions & 0 deletions Games/Angry_Bird/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Angry Birds GG Script</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Angry Birds GG Script</h1>
<button id="modify-coins">Modify Coins</button>
<button id="unlock-levels">Unlock All Levels</button>
<button id="unlock-birds">Unlock All Birds</button>
<button id="exit">Exit</button>
<script src="script.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions Games/Angry_Bird/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"manifest_version": 2,
"name": "Angry Birds GG Script",
"version": "1.0",
"description": "A script to modify coins, unlock levels, and unlock birds in Angry Birds for educational purposes.",
"icons": {
"48": "icon.png"
},
"browser_action": {
"default_popup": "index.html",
"default_icon": "icon.png"
},
"permissions": [
"activeTab"
]
}

49 changes: 49 additions & 0 deletions Games/Angry_Bird/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Function to modify coins
function modifyCoins() {
let coins = prompt("Enter your current amount of coins:");
coins = parseInt(coins);
if (isNaN(coins)) {
alert("Invalid number. Please try again.");
return;
}
let newCoins = 999999;
alert(`Coins modified successfully to ${newCoins}!`);
}

// Function to unlock all levels
function unlockAllLevels() {
alert("All levels unlocked!");
}

// Function to unlock all birds
function unlockAllBirds() {
alert("All birds unlocked!");
}

// Function to handle button clicks
function handleButtonClick(event) {
const buttonId = event.target.id;
switch (buttonId) {
case "modify-coins":
modifyCoins();
break;
case "unlock-levels":
unlockAllLevels();
break;
case "unlock-birds":
unlockAllBirds();
break;
case "exit":
alert("Exiting script...");
break;
default:
break;
}
}

// Add event listeners to buttons
document.getElementById("modify-coins").addEventListener("click", handleButtonClick);
document.getElementById("unlock-levels").addEventListener("click", handleButtonClick);
document.getElementById("unlock-birds").addEventListener("click", handleButtonClick);
document.getElementById("exit").addEventListener("click", handleButtonClick);

21 changes: 21 additions & 0 deletions Games/Angry_Bird/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f0f0;
}

button {
margin: 10px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}

h1 {
margin-bottom: 20px;
}

43 changes: 43 additions & 0 deletions Games/Block_Dodger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# **Block Dodger Game**


<br>

## **Description 📃**
Block Dodger is a simple and addictive browser-based game where players control a character to dodge falling blocks. The goal is to survive as long as possible while accumulating a high score.

<br>

## **functionalities 🎮**

•Character Movement: The player can move the character left and right using the keyboard arrow keys.

•Falling Blocks: Blocks fall from the top of the game area, and the player must dodge them to stay alive.

•Score Tracking: The game tracks the player's score based on how many blocks they successfully dodge.

•Game Over Display: When the game ends, the player's score is displayed on the screen.

<br>

## **How to play? 🕹️**

• Open index.html in a web browser to start the game.

• Use the left (←) and right (→) arrow keys to move the character.

• Avoid falling blocks and try to stay on screen as long as possible.

• The game ends if the character goes off the top of the screen.

• Your score is displayed when the game ends.
<br>

## **Screenshots 📸**
![image](https://github.com/AshishPandey04/GameZone/blob/newBranch/assets/images/Block_Dodger.png)
![image](https://github.com/AshishPandey04/GameZone/blob/newBranch/assets/images/Block_Dodger2.png)

<br>

## **Working video 📹**
![vedio](https://github.com/AshishPandey04/GameZone/blob/newBranch/assets/animations/Block_Dodger.mp4)
32 changes: 32 additions & 0 deletions Games/Block_Dodger/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<title>Falling Ball Game</title>
<link rel="stylesheet" href="style.css" />
</head>

<body>
<nav>
<h1 class="header">
Falling Ball Game
</h1>
</nav>

<div id="game">
<div id="character"></div>

</div>

<h3 style="text-align: center;">Use arrows keys to play game</h3>
<div id="resultBox"></div>

<button id="restartButton" onclick="restartGame()">Restart</button>
</div>


</body>
<script src="script.js"></script>

</html>
119 changes: 119 additions & 0 deletions Games/Block_Dodger/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
var character = document.getElementById("character");
var game = document.getElementById("game");
var interval;
var both = 0;
var counter = 0;
var currentBlocks = [];

function moveLeft() {
// to move the ball left
var left = parseInt(
window.getComputedStyle(character).getPropertyValue("left")
);
if (left > 0) {
character.style.left = left - 2 + "px";
}
}
function moveRight() {
// to move the ball right
var left = parseInt(
window.getComputedStyle(character).getPropertyValue("left")
);
if (left < 380) {
character.style.left = left + 2 + "px";
}
}
document.addEventListener("keydown", event => {
if (both == 0) {
both++;
if (event.key === "ArrowLeft") {
interval = setInterval(moveLeft, 1);
}
if (event.key === "ArrowRight") {
interval = setInterval(moveRight, 1);
}
}
});
document.addEventListener("keyup", event => {
clearInterval(interval);
both = 0;
});

var blocks = setInterval(function () {
var blockLast = document.getElementById("block" + (counter - 1));
var holeLast = document.getElementById("hole" + (counter - 1));
if (counter > 0) {
var blockLastTop = parseInt(
window.getComputedStyle(blockLast).getPropertyValue("top")
);
var holeLastTop = parseInt(
window.getComputedStyle(holeLast).getPropertyValue("top")
);
}
if (blockLastTop < 400 || counter == 0) {
var block = document.createElement("div");
var hole = document.createElement("div");
block.setAttribute("class", "block");
hole.setAttribute("class", "hole");
block.setAttribute("id", "block" + counter);
hole.setAttribute("id", "hole" + counter);
block.style.top = blockLastTop + 100 + "px";
hole.style.top = holeLastTop + 100 + "px";
var random = Math.floor(Math.random() * 360);
hole.style.left = random + "px";
game.appendChild(block);
game.appendChild(hole);
currentBlocks.push(counter);
counter++;
}
var characterTop = parseInt(
window.getComputedStyle(character).getPropertyValue("top")
);
var characterLeft = parseInt(
window.getComputedStyle(character).getPropertyValue("left")
);
var drop = 0;
if (characterTop <= 0) {
resultBox.innerHTML = "Game over. Score: " + (counter - 9);
resultBox.style.display = "block";
clearInterval(blocks);
return;
}
for (var i = 0; i < currentBlocks.length; i++) {
let current = currentBlocks[i];
let iblock = document.getElementById("block" + current);
let ihole = document.getElementById("hole" + current);
let iblockTop = parseFloat(
window.getComputedStyle(iblock).getPropertyValue("top")
);
let iholeLeft = parseFloat(
window.getComputedStyle(ihole).getPropertyValue("left")
);
iblock.style.top = iblockTop - 0.5 + "px";
ihole.style.top = iblockTop - 0.5 + "px";
if (iblockTop < -20) {
currentBlocks.shift();
iblock.remove();
ihole.remove();
}
if (iblockTop - 20 < characterTop && iblockTop > characterTop) {
drop++;
if (iholeLeft <= characterLeft && iholeLeft + 20 >= characterLeft) {
drop = 0;
}
}
}
if (drop == 0) {
if (characterTop < 480) {
character.style.top = characterTop + 2 + "px";
}
} else {
character.style.top = characterTop - 0.5 + "px";
}
}, 1);

function restartGame() {
location.reload();
}

startGame();
Loading

0 comments on commit 554a56b

Please sign in to comment.