diff --git a/Games/Dragon_Ball_Game/Readme.MD b/Games/Dragon_Ball_Game/Readme.MD new file mode 100644 index 0000000000..631e1d813f --- /dev/null +++ b/Games/Dragon_Ball_Game/Readme.MD @@ -0,0 +1,25 @@ +# Dragon Ball Quiz Game + +This is a simple JavaScript-based quiz game featuring questions from the Dragon Ball series. Players can test their knowledge by answering a series of multiple-choice questions. + +## Features + +- **Multiple-choice questions:** Each question has four possible answers, with only one correct answer. +- **Score tracking:** The game keeps track of the player's score and displays it at the end. +- **Feedback on wrong answers:** At the end of the quiz, players can see which questions they answered incorrectly along with the correct answers. + +## Getting Started + +### Prerequisites + +- A modern web browser (Google Chrome, Firefox, Safari, etc.) +- Basic knowledge of HTML, CSS, and JavaScript + +### How to Play + +1. Open the `index.html` file in a web browser. +2. The first question will be displayed with four possible answers. +3. Select the answer you think is correct and click the "Next" button. +4. Continue answering the questions until you reach the end of the quiz. +5. The game will display your score and provide feedback on any incorrect answers. + diff --git a/Games/Dragon_Ball_Game/background.jpg b/Games/Dragon_Ball_Game/background.jpg new file mode 100644 index 0000000000..22a3e6b8e5 Binary files /dev/null and b/Games/Dragon_Ball_Game/background.jpg differ diff --git a/Games/Dragon_Ball_Game/index.html b/Games/Dragon_Ball_Game/index.html new file mode 100644 index 0000000000..0ae534fbfd --- /dev/null +++ b/Games/Dragon_Ball_Game/index.html @@ -0,0 +1,26 @@ + + + + + +One Piece Quiz + + + + + + +
+

Dragon Ball Quiz

+ +
+ +
+ +
+ +
+
+ + + diff --git a/Games/Dragon_Ball_Game/script.js b/Games/Dragon_Ball_Game/script.js new file mode 100644 index 0000000000..29bd32a74e --- /dev/null +++ b/Games/Dragon_Ball_Game/script.js @@ -0,0 +1,255 @@ +const questions = [ + { + question: "What is Goku's Saiyan name?", + answers: [ + { text: "Kakarot", correct: true }, + { text: "Raditz", correct: false }, + { text: "Vegeta", correct: false }, + { text: "Bardock", correct: false } + ] + }, + { + question: "Who created the Dragon Balls?", + answers: [ + { text: "Kami", correct: false }, + { text: "King Kai", correct: false }, + { text: "Namekians", correct: true }, + { text: "Supreme Kai", correct: false } + ] + }, + { + question: "What is the highest Super Saiyan level Goku reaches in Dragon Ball Z?", + answers: [ + { text: "Super Saiyan 2", correct: false }, + { text: "Super Saiyan 3", correct: true }, + { text: "Super Saiyan 4", correct: false }, + { text: "Super Saiyan God", correct: false } + ] + }, + { + question: "What is the name of Goku's first son?", + answers: [ + { text: "Gohan", correct: true }, + { text: "Trunks", correct: false }, + { text: "Goten", correct: false }, + { text: "Krillin", correct: false } + ] + }, + { + question: "Who defeats Cell in the Cell Saga?", + answers: [ + { text: "Goku", correct: false }, + { text: "Vegeta", correct: false }, + { text: "Gohan", correct: true }, + { text: "Trunks", correct: false } + ] + }, + { + question: "Which character is known for their destructo disc attack?", + answers: [ + { text: "Goku", correct: false }, + { text: "Vegeta", correct: false }, + { text: "Krillin", correct: true }, + { text: "Piccolo", correct: false } + ] + }, + { + question: "What is the name of Vegeta's father?", + answers: [ + { text: "King Cold", correct: false }, + { text: "King Kai", correct: false }, + { text: "King Vegeta", correct: true }, + { text: "King Piccolo", correct: false } + ] + }, + { + question: "Which Dragon Ball character is a reincarnation of Majin Buu?", + answers: [ + { text: "Uub", correct: true }, + { text: "Broly", correct: false }, + { text: "Jiren", correct: false }, + { text: "Beerus", correct: false } + ] + }, + { + question: "What is the name of the fusion technique that Goku and Vegeta use?", + answers: [ + { text: "Potara Fusion", correct: false }, + { text: "Fusion Dance", correct: true }, + { text: "Metamoran Fusion", correct: false }, + { text: "Namekian Fusion", correct: false } + ] + }, + { + question: "Who is the main antagonist of the Frieza Saga?", + answers: [ + { text: "Cell", correct: false }, + { text: "Majin Buu", correct: false }, + { text: "Frieza", correct: true }, + { text: "Android 18", correct: false } + ] + }, + { + question: "What is the name of the planet where Goku trains with King Kai?", + answers: [ + { text: "Planet Vegeta", correct: false }, + { text: "Planet Namek", correct: false }, + { text: "Planet Yardrat", correct: false }, + { text: "King Kai's Planet", correct: true } + ] + }, + { + question: "Who is the legendary Super Saiyan that appears in the Dragon Ball Z movies?", + answers: [ + { text: "Broly", correct: true }, + { text: "Bardock", correct: false }, + { text: "Turles", correct: false }, + { text: "Paragus", correct: false } + ] + }, + { + question: "What is the technique used by Master Roshi to increase his strength and size?", + answers: [ + { text: "Kaio-ken", correct: false }, + { text: "Kamehameha", correct: false }, + { text: "Roshi Power-Up", correct: false }, + { text: "Max Power", correct: true } + ] + }, + { + question: "Which form does Frieza take when he first fights Goku on Planet Namek?", + answers: [ + { text: "First Form", correct: false }, + { text: "Second Form", correct: false }, + { text: "Third Form", correct: false }, + { text: "Final Form", correct: true } + ] + }, + { + question: "What is the special ability of the Namekian Dragon Balls compared to the Earth Dragon Balls?", + answers: [ + { text: "They can grant any wish", correct: false }, + { text: "They are larger in size", correct: false }, + { text: "They can grant three wishes", correct: true }, + { text: "They have no limitations", correct: false } + ] + }, + { + question: "Who is the Supreme Kai's attendant?", + answers: [ + { text: "Whis", correct: false }, + { text: "Beerus", correct: false }, + { text: "Kibito", correct: true }, + { text: "Elder Kai", correct: false } + ] + }, + { + question: "What technique does Goku use to travel long distances instantly?", + answers: [ + { text: "Flying Nimbus", correct: false }, + { text: "Kaio-ken", correct: false }, + { text: "Instant Transmission", correct: true }, + { text: "Fusion Dance", correct: false } + ] + }, + { + question: "Which form of Buu absorbs Gohan?", + answers: [ + { text: "Kid Buu", correct: false }, + { text: "Fat Buu", correct: false }, + { text: "Super Buu", correct: true }, + { text: "Evil Buu", correct: false } + ] + }, + { + question: "What is the name of the God of Destruction introduced in Dragon Ball Super?", + answers: [ + { text: "Champa", correct: false }, + { text: "Beerus", correct: true }, + { text: "Whis", correct: false }, + { text: "Zeno", correct: false } + ] + }, + { + question: "Which character kills King Piccolo?", + answers: [ + { text: "Goku", correct: true }, + { text: "Piccolo Jr.", correct: false }, + { text: "Tien", correct: false }, + { text: "Kami", correct: false } + ] + } +]; + + + let currentQuestion = 0; + let score = 0; + let wrongAnswers = []; + + const questionContainer = document.getElementById('question-container'); + const nextButton = document.getElementById('next-btn'); + const resultContainer = document.getElementById('result'); + + function displayQuestion() { + const currentQ = questions[currentQuestion]; + questionContainer.innerHTML = ` +

${currentQ.question}

+ + `; + nextButton.style.display = 'inline'; + } + + function checkAnswer() { + const selectedAnswer = document.querySelector('input[name="answer"]:checked'); + if (!selectedAnswer) return; + + if (selectedAnswer.value === 'true') { + score++; + } else { + wrongAnswers.push({ + question: questions[currentQuestion].question, + correctAnswer: questions[currentQuestion].answers.find(answer => answer.correct).text, + userAnswer: selectedAnswer.nextElementSibling.innerText + }); + } + + currentQuestion++; + selectedAnswer.checked = false; + + if (currentQuestion < questions.length) { + displayQuestion(); + } else { + showResult(); + } + } + + function showResult() { + questionContainer.innerHTML = ''; + nextButton.style.display = 'none'; + + resultContainer.innerHTML = `

Your Score: ${score}/${questions.length}

`; + if (wrongAnswers.length > 0) { + resultContainer.innerHTML += '

Incorrect Answers:

'; + wrongAnswers.forEach(wrong => { + resultContainer.innerHTML += ` +

Question: ${wrong.question}

+

Your Answer: ${wrong.userAnswer}

+

Correct Answer: ${wrong.correctAnswer}

+ `; + }); + } + } + + displayQuestion(); + + nextButton.addEventListener('click', function() { + this.classList.add('button-clicked'); + checkAnswer(); + }); \ No newline at end of file diff --git a/Games/Dragon_Ball_Game/style.css b/Games/Dragon_Ball_Game/style.css new file mode 100644 index 0000000000..61a9903f48 --- /dev/null +++ b/Games/Dragon_Ball_Game/style.css @@ -0,0 +1,43 @@ +body { + font-family: Arial, sans-serif; + + } + .heading-container{ + font-family: "Press Start 2P", system-ui; + font-weight: 400; + font-style: normal; + align-self: center; + margin-left: 20%; + font-size: 30px; + + } + + .quiz-container { + max-width: 600px; + margin: 20px auto; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + background-color: rgba(255, 255, 255, 0.7); + margin-top: 225px; + align-items: center; + font-family: "Press Start 2P", system-ui; + font-weight: 400; + font-style: normal; + } + + button { + padding: 10px 20px; + margin-top: 10px; + cursor: pointer; + font-family: "Press Start 2P", system-ui; + font-weight: 400; + font-style: normal; + background-color: #23407b;; + } + + button:hover { + background-color: #e48d30; + color: #080808; + } + \ No newline at end of file diff --git a/README.md b/README.md index 0bd7a7d2a1..7dd3d46bd4 100644 --- a/README.md +++ b/README.md @@ -852,7 +852,7 @@ This repository also provides one such platforms where contributers come over an |[Matching_Pair](https://github.com/kunjgit/GameZone/tree/main/Games/Matching_pair) |[Number Guessing Game](https://github.com/kunjgit/GameZone/tree/main/Games/Number_Guessing-Game) - +| [Dragon Ball Game](https://github.com/kunjgit/GameZone/tree/main/Games/Dragon_Ball_Game) | |[Otherworldly_Odyssey](./Games/Otherworldly_Odyssey/)| diff --git a/assets/images/Dragon_Ball_Game.jpg b/assets/images/Dragon_Ball_Game.jpg new file mode 100644 index 0000000000..22a3e6b8e5 Binary files /dev/null and b/assets/images/Dragon_Ball_Game.jpg differ