-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
4,036 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[LocalizedFileNames] | ||
Screenshot 2024-07-23 101337.png=@Screenshot 2024-07-23 101337,0 | ||
Screenshot 2024-07-23 101316.png=@Screenshot 2024-07-23 101316,0 | ||
Screenshot 2024-07-23 101249.png=@Screenshot 2024-07-23 101249,0 | ||
Screenshot 2024-07-23 101237.png=@Screenshot 2024-07-23 101237,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>BOOM BLAST</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div id="game-title">BOOM BLAST</div> | ||
<div id="score">Score: 0</div> | ||
<div id="timer">Time: 30s</div> | ||
<div id="game-area"> | ||
<div id="game-over"></div> | ||
</div> | ||
<div id="controls"> | ||
<button id="start-button">Start Game</button> | ||
<select id="time-select"> | ||
<option value="30">30 seconds</option> | ||
<option value="60">60 seconds</option> | ||
<option value="90">90 seconds</option> | ||
<option value="120">120 seconds</option> | ||
</select> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# BOOM BLAST | ||
|
||
BOOM BLAST is a fun and colorful browser-based game where players click on balloons to score points before time runs out. | ||
|
||
## Table of Contents | ||
|
||
- [Features](#features) | ||
- [Installation](#installation) | ||
- [How to Play](#how-to-play) | ||
- [Game Mechanics](#game-mechanics) | ||
- [Customization](#customization) | ||
- [Technologies Used](#technologies-used) | ||
|
||
## Features | ||
|
||
- Vibrant, dynamic background | ||
- Colorful balloons with gradient effects | ||
- Customizable game duration | ||
- Real-time score and timer display | ||
- Responsive design | ||
|
||
## Installation | ||
|
||
1. Clone this repository . | ||
```bash | ||
clone git https://github.com/kunjgit/GameZone/tree/main/Games/Boom_Blast | ||
``` | ||
2. Open the `index.html` file in a web browser to start the game. | ||
|
||
## How to Play | ||
|
||
1. Open the game in a web browser. | ||
2. Select the desired game duration from the dropdown menu. | ||
3. Click the "Start Game" button to begin. | ||
4. Click on the balloons as they appear to score points. | ||
5. Try to click as many balloons as possible before time runs out. | ||
6. When the game ends, your final score will be displayed. | ||
7. Click "Start Game" again to play another round. | ||
|
||
## Game Mechanics | ||
|
||
- Balloons appear randomly within the game area every second. | ||
- Each balloon has a random size and color gradient. | ||
- Clicking a balloon adds 1 point to your score and removes the balloon. | ||
- Balloons automatically disappear after 2 seconds if not clicked. | ||
- The game ends when the timer reaches zero. | ||
|
||
## Customization | ||
|
||
You can customize the game by modifying the following: | ||
|
||
- Game duration options in the HTML file | ||
- Colors and animations in the CSS file | ||
- Balloon spawn rate and game logic in the JavaScript file | ||
|
||
## Technologies Used | ||
|
||
- HTML5 | ||
- CSS3 | ||
- JavaScript (ES6+) | ||
|
||
Feel free to fork this project and customize it to your liking. Enjoy playing BOOM BLAST! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
const gameArea = document.getElementById('game-area'); | ||
const startButton = document.getElementById('start-button'); | ||
const scoreElement = document.getElementById('score'); | ||
const timerElement = document.getElementById('timer'); | ||
const gameOverElement = document.getElementById('game-over'); | ||
const timeSelect = document.getElementById('time-select'); | ||
|
||
let score = 0; | ||
let timeLeft = 30; | ||
let gameInterval; | ||
let balloonInterval; | ||
|
||
startButton.addEventListener('click', startGame); | ||
|
||
function startGame() { | ||
score = 0; | ||
timeLeft = parseInt(timeSelect.value); | ||
updateScore(); | ||
updateTimer(); | ||
startButton.disabled = true; | ||
timeSelect.disabled = true; | ||
gameOverElement.style.display = 'none'; | ||
clearInterval(gameInterval); | ||
clearInterval(balloonInterval); | ||
|
||
gameInterval = setInterval(() => { | ||
timeLeft--; | ||
updateTimer(); | ||
if (timeLeft <= 0) { | ||
endGame(); | ||
} | ||
}, 1000); | ||
|
||
balloonInterval = setInterval(createBalloon, 1000); | ||
} | ||
|
||
function createBalloon() { | ||
const balloon = document.createElement('div'); | ||
balloon.classList.add('balloon'); | ||
const size = Math.random() * 50 + 20; | ||
const colors = getRandomGradient(); | ||
|
||
balloon.style.width = `${size}px`; | ||
balloon.style.height = `${size}px`; | ||
balloon.style.background = colors; | ||
balloon.style.left = `${Math.random() * (gameArea.clientWidth - size)}px`; | ||
balloon.style.top = `${Math.random() * (gameArea.clientHeight - size)}px`; | ||
|
||
balloon.addEventListener('click', () => { | ||
score++; | ||
updateScore(); | ||
gameArea.removeChild(balloon); | ||
}); | ||
|
||
gameArea.appendChild(balloon); | ||
|
||
setTimeout(() => { | ||
if (gameArea.contains(balloon)) { | ||
gameArea.removeChild(balloon); | ||
} | ||
}, 2000); | ||
} | ||
|
||
function getRandomGradient() { | ||
const color1 = getRandomColor(); | ||
const color2 = getRandomColor(); | ||
return `radial-gradient(circle, ${color1}, ${color2})`; | ||
} | ||
|
||
function getRandomColor() { | ||
const letters = '0123456789ABCDEF'; | ||
let color = '#'; | ||
for (let i = 0; i < 6; i++) { | ||
color += letters[Math.floor(Math.random() * 16)]; | ||
} | ||
return color; | ||
} | ||
|
||
function updateScore() { | ||
scoreElement.textContent = `Score: ${score}`; | ||
} | ||
|
||
function updateTimer() { | ||
timerElement.textContent = `Time: ${timeLeft}s`; | ||
} | ||
|
||
function endGame() { | ||
clearInterval(gameInterval); | ||
clearInterval(balloonInterval); | ||
gameOverElement.textContent = `Game Over! Final Score: ${score}`; | ||
gameOverElement.style.display = 'block'; | ||
startButton.disabled = false; | ||
timeSelect.disabled = false; | ||
while (gameArea.firstChild) { | ||
gameArea.removeChild(gameArea.firstChild); | ||
} | ||
gameArea.appendChild(gameOverElement); | ||
} |
Oops, something went wrong.