diff --git a/Games/Guess_That_Pokemon/README.md b/Games/Guess_That_Pokemon/README.md new file mode 100644 index 0000000000..3f33a9858b --- /dev/null +++ b/Games/Guess_That_Pokemon/README.md @@ -0,0 +1,35 @@ +# **Game_Name** +Guess That Pokemon + +
+ +## **Description 📃** + +- A black outline of the pokemon will be displayed on the screen and the player has to guess which pokemon it is. + + +## **functionalities 🎮** + +- There will be options for guess, quit and hint. +
+ +## **How to play? 🕹️** + +- If the player guesses the pokemon without using a hint they are rewarded 100 points. +- If the player guesses the pokemon after taking a hint they are rewarded 50 points. +- If the player incorrectly guesses the pokemon they get 0 points. +- If the player quits they get 0 points. + +
+ +## **Screenshots 📸** + + + +![Guess That Pokemon](./assests/pokemon1.png) + +
+ +## **Working video 📹** + +![Guess That Pokemon](./assests/pokemon3.png) \ No newline at end of file diff --git a/Games/Guess_That_Pokemon/allPokemons.js b/Games/Guess_That_Pokemon/allPokemons.js new file mode 100644 index 0000000000..20c4d1d86b --- /dev/null +++ b/Games/Guess_That_Pokemon/allPokemons.js @@ -0,0 +1,200 @@ +var abra = { + name: "abra", + source: "https://archives.bulbagarden.net/media/upload/9/9e/PCP063.png", + hint:"A small, timid Psychic-type Pokémon with exceptional telekinetic abilities. It's powers manifest most strongly during sleep." +} + +var alakazam = { + name: "alakazam", + source: "https://archives.bulbagarden.net/media/upload/a/a6/PCP065.png", + hint:"The highly intelligent evolution of Abra, boasting immense psychic power. Known for its telepathy and spoon-bending abilities" +} + +var arcanine ={ + name:"arcanine", + source:"https://archives.bulbagarden.net/media/upload/thumb/4/42/0059Arcanine.png/375px-0059Arcanine.png", + hint:"A Fire-type Pokémon and it evolves from Growlithe when exposed to a Fire Stone." +} + +var arbok = { + name: "arbok", + source: "https://archives.bulbagarden.net/media/upload/9/9d/PCP024.png", + hint:"A large, intimidating Poison-type snake Pokémon with a venomous bite." +} + +var articuno = { + name: "articuno", + source: "https://archives.bulbagarden.net/media/upload/d/db/PCP144.png", + hint:"A legendary Ice/Flying-type bird Pokémon with the power to freeze its surroundings." +} + +var beedrill = { + name: "beedrill", + source: "https://archives.bulbagarden.net/media/upload/a/ac/PCP015.png", + hint:"A fierce Bug/Poison-type with venomous stingers." +} + +var bulbasaur = { + name: "bulbasaur", + source: "https://archives.bulbagarden.net/media/upload/thumb/f/fb/0001Bulbasaur.png/375px-0001Bulbasaur.png", + hint:"Along with Charmander and Squirtle, this is one of the three first partner Pokémon of Ash available at the beginning of Pokémon Red, " +} + +var charmander = { + name: "charmander", + source: "https://archives.bulbagarden.net/media/upload/6/6f/PCP004.png", + hint:"A small, lizard-like Fire-type with a burning tail. Its flame grows stronger with its emotions." +} + +var charmeleon = { + name: "charmeleon", + source: "https://archives.bulbagarden.net/media/upload/f/f5/PCP005.png", + hint:"The fiery evolution of Charmander, known for its aggressive nature and powerful flame attacks." +} + +var charizard = { + name: "charizard", + source: "https://archives.bulbagarden.net/media/upload/5/5e/PCP006.png", + hint:"A formidable Fire/Flying-type, it is capable of unleashing devastating fire-based attacks." +} + +var chimecho = { + name: "chimecho", + source: "https://archives.bulbagarden.net/media/upload/7/7e/PCP358.png", + hint:"A floating, bell-shaped Psychic-type with a calming aura. Its melodious chimes can soothe or confuse opponents." +} + +var crobat = { + name: "crobat", + source: "https://archives.bulbagarden.net/media/upload/e/e3/PCP169.png", + hint:"A fast and agile Poison/Flying-type with keen eyesight." +} + +var dragonair = { + name: "dragonair", + source: "https://archives.bulbagarden.net/media/upload/9/95/PCP148.png", + hint:"A serpentine Dragon-type Pokémon with the ability to control weather." +} + +var eevee = { + name: "eevee", + source: "https://archives.bulbagarden.net/media/upload/9/98/PCP133.png", + hint:"A small, fox-like Normal-type with the unique ability to evolve into different forms based on various conditions." +} + +var ekans = { + name: "ekans", + source: "https://archives.bulbagarden.net/media/upload/thumb/d/d2/0023Ekans.png/375px-0023Ekans.png", + hint:"It is a Poison-type Pokémon.It evolves into Arbok" +} + +var espeon = { + name: "espeon", + source: "https://archives.bulbagarden.net/media/upload/5/5f/PCP196.png", + hint:"An evolution of Eevee, it is a Psychic-type with heightened senses and the ability to predict opponents' moves." +} + +var flareon = { + name: "flareon", + source: "https://archives.bulbagarden.net/media/upload/2/2d/PCP136.png", + hint:"An evolution of Eevee, it is a Fire-type with an intense, fiery coat." +} + +var glaceon = { + name: "glaceon", + source: "https://archives.bulbagarden.net/media/upload/d/d0/PCP471.png", + hint:" An Ice-type evolution of Eevee, it possesses the ability to freeze nearby water." +} + +var golbat = { + name: "golbat", + source: "https://archives.bulbagarden.net/media/upload/e/ea/PCP042.png", + hint:"A larger, more powerful evolution of Zubat, this Poison/Flying-type is known for its sharp teeth and high speed." +} + +var gyarados = { + name: "gyarados", + source: "https://archives.bulbagarden.net/media/upload/9/9d/PCP130.png", + hint:"A monstrous Water/Flying-type with a violent temper. Once a Magikarp, it undergoes a dramatic transformation." +} + +var haunter = { + name: "haunter", + source: "https://archives.bulbagarden.net/media/upload/8/84/PCP093.png", + hint:"A mischievous Ghost/Poison-type with the ability to possess others." +} + +var horsea = { + name: "horsea", + source: "https://archives.bulbagarden.net/media/upload/thumb/1/14/0116Horsea.png/375px-0116Horsea.png", + hint:"It is a Water-type Pokémon.It evolves into Seadra which evolves into Kingdra when traded while holding a Dragon Scale." +} + +var igglybuff = { + name: "igglybuff", + source: "https://archives.bulbagarden.net/media/upload/9/9f/PCP174.png", + hint:"A pink, round Normal-type known for its sweet singing voice." +} + +var jigglypuff = { + name: "jigglypuff", + source: "https://archives.bulbagarden.net/media/upload/b/b4/PCP039.png", + hint:"The evolved form of Igglybuff, still adorable but with a powerful singing voice that can induce sleep." +} + +var jolteon = { + name: "jolteon", + source: "https://archives.bulbagarden.net/media/upload/5/58/PCP135.png", + hint:"An Electric-type evolution of Eevee known for its incredible speed and powerful electric attacks." +} + +var kadabra = { + name: "kadabra", + source: "https://archives.bulbagarden.net/media/upload/4/4b/PCP064.png", + hint:"The intermediate stage between Abra and Alakazam, possessing increased psychic prowess." +} + +var magikarp = { + name: "magikarp", + source: "https://archives.bulbagarden.net/media/upload/thumb/d/d1/0129Magikarp.png/375px-0129Magikarp.png", + hint:" A weak, water-type Pokémon known for its inability to battle effectively. Despite its unimpressive appearance and abilities, it evolves into the powerful Gyarados." +} + +var magneton = { + name: "magneton", + source: "https://archives.bulbagarden.net/media/upload/thumb/d/d9/0082Magneton.png/375px-0082Magneton.png", + hint:"An Electric/Steel-type Pokémon formed by three Magnemite linked together. Known for its strong magnetic force and ability to generate powerful electric attacks." +} + +var meowth = { + name: "meowth", + source: "https://archives.bulbagarden.net/media/upload/thumb/d/d6/0052Meowth.png/375px-0052Meowth.png", + hint:"A Normal-type Team Rocket Pokémon known for its cunning and ambition. Often seen carrying coins, it dreams of becoming rich." +} + +var pichu = { + name: "pichu", + source: "https://archives.bulbagarden.net/media/upload/thumb/f/f3/0172Pichu.png/375px-0172Pichu.png", + hint:"A small, Electric-type baby Pokémon with a playful and curious nature. Known for its unpredictable electric shocks caused by excitement or surprise." +} + +var pidgey = { + name: "pidgey", + source: "https://archives.bulbagarden.net/media/upload/thumb/0/0c/0016Pidgey.png/375px-0016Pidgey.png", + hint:"A common Normal/Flying-type Pokémon known for its docile nature. Often found in grassy areas, it prefers to flee from danger rather than fight." +} + +var pikachu = { + name: "pikachu", + source: "https://archives.bulbagarden.net/media/upload/thumb/4/4a/0025Pikachu.png/375px-0025Pikachu.png", + hint:"An iconic Electric-type Pokémon known for its cheerful personality and electric attacks. It stores electricity in its cheeks, which it can release in powerful bolts." +} + +var psyduck = { + name: "psyduck", + source: "https://archives.bulbagarden.net/media/upload/thumb/3/3f/0054Psyduck.png/375px-0054Psyduck.png", + hint:"A Water-type Pokémon known for its constant headaches. Despite its dazed appearance, it possesses hidden psychic powers that are often unleashed unintentionally due to the pain." +} + + + diff --git a/Games/Guess_That_Pokemon/assests/pokemon.jpg b/Games/Guess_That_Pokemon/assests/pokemon.jpg new file mode 100644 index 0000000000..c7894e7c16 Binary files /dev/null and b/Games/Guess_That_Pokemon/assests/pokemon.jpg differ diff --git a/Games/Guess_That_Pokemon/assests/pokemon1.png b/Games/Guess_That_Pokemon/assests/pokemon1.png new file mode 100644 index 0000000000..1f256f374b Binary files /dev/null and b/Games/Guess_That_Pokemon/assests/pokemon1.png differ diff --git a/Games/Guess_That_Pokemon/assests/pokemon2.png b/Games/Guess_That_Pokemon/assests/pokemon2.png new file mode 100644 index 0000000000..320e5c9c77 Binary files /dev/null and b/Games/Guess_That_Pokemon/assests/pokemon2.png differ diff --git a/Games/Guess_That_Pokemon/assests/pokemon3.png b/Games/Guess_That_Pokemon/assests/pokemon3.png new file mode 100644 index 0000000000..72e5386d83 Binary files /dev/null and b/Games/Guess_That_Pokemon/assests/pokemon3.png differ diff --git a/Games/Guess_That_Pokemon/index.html b/Games/Guess_That_Pokemon/index.html new file mode 100644 index 0000000000..8f3d95ee44 --- /dev/null +++ b/Games/Guess_That_Pokemon/index.html @@ -0,0 +1,56 @@ + + + + + + + + Who's that Pokemon? + + + + + + + + + + + + + +
+

Who's that Pokemon?

+
+ +
+ +
+ some image +
+ + +
+ + + +
+ +
+ + + +
+ +
+ + + + + + \ No newline at end of file diff --git a/Games/Guess_That_Pokemon/script.js b/Games/Guess_That_Pokemon/script.js new file mode 100644 index 0000000000..283e543787 --- /dev/null +++ b/Games/Guess_That_Pokemon/script.js @@ -0,0 +1,86 @@ +/* As soon as you initialize the page, choose a random image */ +window.onload = choosePic; +let index; +let points = 0; +let hintTaken = false; + +/* Array that receives all Pokemons in the game. You can greatly improve this array */ +const allPokemons = new Array(abra, alakazam, arcanine, arbok, articuno, beedrill, bulbasaur, charmander, + charmeleon, charizard, chimecho, crobat, dragonair, eevee, ekans, espeon, flareon, glaceon, golbat, + gyarados, haunter, horsea, igglybuff, jigglypuff, jolteon, kadabra, magikarp, magneton, + meowth, pichu, pidgey, pikachu, psyduck); + +function randomNumber() { + return Math.floor(Math.random() * allPokemons.length) + 1; +} + +/* Choose a random Pokemon */ +function choosePic() { + index = randomNumber(); + document.getElementById("canvas").src = allPokemons[index].source; + hintTaken = false; +} + +function clearInput() { + document.getElementById("guessInput").value = ""; +} + +function showAlert(num) { + if (num == 1) { + if (!hintTaken) { + points += 100; + } else { + points += 50; + } + document.getElementById("modal-message").innerText="Congratulations, You did it! It's " + allPokemons[index].name + "!"+"You earned " + (hintTaken ? 50 : 100) + " points!" +"\n Total Points are :" + points; + document.getElementById("modal").style.display = "block"; + } else { + document.getElementById("modal-message").innerText = "Oops, Thats' not correct. It was " + allPokemons[index].name + "!"; + document.getElementById("modal").style.display = "block"; + points += 0; + } + // Add event listener to the cancel button + var closeButton = document.querySelector(".close"); + closeButton.addEventListener("click", function() { + document.getElementById("modal").style.display = "none"; + }); +} + +function tryGuess() { + if (document.getElementById("guessInput").value.trim().toLowerCase() === allPokemons[index].name) { + + showAlert(1); + document.getElementById("canvas").style.filter = "brightness(100%)"; + allPokemons.splice(index, 1); + + if (allPokemons.length >= 1){ + setTimeout(function () { + + document.getElementById("canvas").style.filter = "brightness(0%)"; + choosePic(); + clearInput(); + + }, 500); + } else { + alert("You managed to guess all the Pokemons! You are awesome! Thanks for playing, I hope you had fun ^~^ ") + document.getElementById("title").innerHTML = "You win! Yay!"; + } + + } else { + showAlert(0); + choosePic(); + clearInput(); + } +} + +function giveHint() { + hintTaken = true; + document.getElementById("modal-message").innerText="Hint: " + allPokemons[index].hint; + document.getElementById("modal").style.display = "block"; + + // Add event listener to the cancel button + var closeButton = document.querySelector(".close"); + closeButton.addEventListener("click", function() { + document.getElementById("modal").style.display = "none"; + }); +} \ No newline at end of file diff --git a/Games/Guess_That_Pokemon/style.css b/Games/Guess_That_Pokemon/style.css new file mode 100644 index 0000000000..fa7d51b9fe --- /dev/null +++ b/Games/Guess_That_Pokemon/style.css @@ -0,0 +1,143 @@ +body { + background: url('./assests/pokemon.jpg') no-repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + height: 100%; + text-align: center; +} + +img { + width: 100%; + height: 100%; +} + +figure { + border: 10px solid #000000; + background-color: #FFFFFF; + margin-left: auto; + margin-right: auto; + width: 200px; + height: 200px; + text-align: center; + border-radius: 5px; + padding: 15px; +} + +button { + font-family: 'Indie Flower'; + font-weight: bold; + border: none; + border-radius: 15px; + width: 200px; + height: 50px; + margin: 5px; + background-color: #C9CBA3; + color: #59594A; + font-size: 30px; + transition: 0.05s; + padding: 5px;; +} + +button:hover { + cursor: pointer; + background-color: #bf8028; + color: #FFFFFF; +} + +header { + font-family: 'Indie Flower', cursive; + font-size: 20px; +} + +#canvas { + filter: brightness(0%); +} + +.box { + margin: 15px; + padding: 10px; +} + +.main { + display: inline-block; + background-color: #322c2b; + width: 500px; + height: 500px; + background-color: rgba(0, 0, 255, 0.2); /* blue color with 20% opacity */ + backdrop-filter: blur(10px); /* blur the background behind the box */ + -webkit-backdrop-filter: blur(10px); /* for Safari and Chrome */ + padding: 20px; + margin: 40px auto; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} + +.main { + background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3)); + border: 1px solid rgba(255, 255, 255, 0.5); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 255, 0.2); + } + +.main input { + width: 70%; + height: 30px; + font-size: 300%; + text-align: center; + padding: 10px; + border-radius: 5px; +} + +.modal { + display: none; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); +} + +.modal-content { + background-color: #f1f1f1; + margin: 15% auto; + padding: 20px; + border: 1px solid #888; + width: 80%; + max-width: 800px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); +} + +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +/* Responsive design */ +@media only screen and (max-width: 600px) { + .main { + width: 80%; + height: 80% + } + .main input { + width: 90%; + } + button { + width: 90%; + } + .modal-content { + width: 90%; + } +} \ No newline at end of file diff --git a/README.md b/README.md index 8c15800a80..9c5a3c4b49 100644 --- a/README.md +++ b/README.md @@ -107,11 +107,12 @@ This repository also provides one such platforms where contributers come over an -| Game | Game | Game | Game | Game -| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | --- | -|[Block Dodger](https://github.com/kunjgit/GameZone/tree/main/Games/Block_Dodger) | [Master Typing](https://github.com/kunjgit/GameZone/tree/main/Games/Master_Typing) | [Treasure Hunt](https://github.com/Antiquely3059/GameZone/tree/main/Games/Treasure%20Hunt) | [Virtual Pet](https://github.com/Antiquely3059/GameZone/tree/main/Games/Virtual_Pet) | [MazeRunner](https://github.com/kunjgit/GameZone/tree/main/Games/MazeRunner) | [Ping_Pong_Singleplayer](https://github.com/kunjgit/GameZone/tree/main/Games/Ping_Pong_Singleplayer) | | +| Game | Game | Game | Game | Game | +| [Master Typing](https://github.com/kunjgit/GameZone/tree/main/Games/Master_Typing) | [Treasure Hunt](https://github.com/Antiquely3059/GameZone/tree/main/Games/Treasure%20Hunt) | [Virtual Pet](https://github.com/Antiquely3059/GameZone/tree/main/Games/Virtual_Pet) | [MazeRunner](https://github.com/kunjgit/GameZone/tree/main/Games/MazeRunner) | [Ping_Pong_Singleplayer](https://github.com/kunjgit/GameZone/tree/main/Games/Ping_Pong_Singleplayer) | [Madlibs](https://github.com/AaryanManghnani/GameZone/tree/main/Games/Madlibs) | +| [Bulls_And_Cows_New](https://github.com/kunjgit/GameZone/tree/main/Games/Bulls_And_Cows_New) +| [Guess_That_Pokemon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_That_Pokemon) | [Tilting Maze](https://github.com/kunjgit/GameZone/tree/main/Games/Tilting_Maze) | [Simon Game Challenge](https://github.com/kunjgit/GameZone/tree/main/Games/Simon_Game_Challenge) | [Snake Game](https://github.com/kunjgit/GameZone/tree/main/Games/Snake_Game) | [Dino Runner Game](https://github.com/kunjgit/GameZone/tree/main/Games/Dino_Runner_Game) | -| [Whack a Mole](https://github.com/kunjgit/GameZone/tree/main/Games/Whack_a_Mole) | [Doraemon Jump](https://github.com/kunjgit/GameZone/tree/main/Games/Doraemon_Jump) | [Black Jack](https://github.com/kunjgit/GameZone/tree/main/Games/Black_Jack) | [Memory Game](https://github.com/kunjgit/GameZone/tree/main/Games/Memory_Game) | [Word Guessing Game](https://github.com/kunjgit/GameZone/tree/main/Games/Word_Guessing_Game) | +| [Whack a Mole](https://github.com/kunjgit/GameZone/tree/main/Games/Whack_a_Mole) | [Doraemon Jump](https://github.com/kunjgit/GameZone/tree/main/Games/Doraemon_Jump) | [Black Jack](https://github.com/kunjgit/GameZone/tree/main/Games/Black_Jack) | [Memory Game](https://github.com/kunjgit/GameZone/tree/main/Games/Memory_Game) | [Word Guessing Game](https://github.com/kunjgit/GameZone/tree/main/Games/Word_Guessing_Game) | [Ludo Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ludo_Game) | [Piano Game](https://github.com/kunjgit/GameZone/tree/main/Games/Piano) | [Atari Breakout](https://github.com/kunjgit/GameZone/tree/main/Games/Atari_Breakout) | [Dinosaur Game](https://github.com/kunjgit/GameZone/tree/main/Games/Chrome_Dinosaur_Game) | [Guess The Colour by RGB Game](https://github.com/kunjgit/GameZone/tree/main/Games/Colour_Guessing_Game) | | [Guess The Number](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Number) | [Race car game](https://github.com/kunjgit/GameZone/tree/main/Games/race_car) | [Aim Training](https://github.com/DP-NOTHING/GameZone/tree/contri/Games/Aim_Training) | [Alien Shooter](https://github.com/kunjgit/GameZone/tree/main/Games/Alien_Shooters) | [Fruit Ninja](https://github.com/kunjgit/GameZone/tree/main/Games/Fruit_Ninja) | | [Doodle Jump](https://github.com/kunjgit/GameZone/tree/main/Games/Doodle_Jump) | [Alphabet Game](https://github.com/kunjgit/GameZone/tree/main/Games/Alphabet) | [Candy Crush](https://github.com/kunjgit/GameZone/tree/main/Games/Candy_Crush) | [Word Association Game](https://github.com/kunjgit/GameZone/tree/main/Games/Word_Association_Game) | [Tic Tac Toe](https://github.com/kunjgit/GameZone/tree/main/Games/Tic_Tac_Toe) | diff --git a/assets/images/Guess_That_Pokemon.png b/assets/images/Guess_That_Pokemon.png new file mode 100644 index 0000000000..1f256f374b Binary files /dev/null and b/assets/images/Guess_That_Pokemon.png differ