diff --git a/Games/Otherworldly_Odyssey/README.md b/Games/Otherworldly_Odyssey/README.md new file mode 100644 index 0000000000..28a492f6cb --- /dev/null +++ b/Games/Otherworldly_Odyssey/README.md @@ -0,0 +1,38 @@ +# **Otherworldly Odyssey** + +--- + +
+ +## **Description 📃** +It's an adventure role playing game where players will journey through a magical realm full of fantastic creatures, deadly challenges, and hidden surprises. +- + +## **functionalities 🎮** +1. This game has an innovative XP system which would make it more engaging and fun to play. +2. A money system which can be used to buy various products. +3. A shop where the adventurers can buy elixirs to increase or recover their health or weapons ranging from a simple dagger to a legendary magic wand. +4. Player can earn money and farm XP by fighting various monsters to ultimately challenge the greatest threat this realm has ever faced a "Primordial Dragon". +5. An Easter Egg minigame hidden in the main game. +- +
+ +## **How to play? 🕹️** +Simply click on the button of the action you'll like to choose to perform and follow the instructions. +- + +
+ +## **Screenshots 📸** + +
+ + +![ss1](./img/Screenshot%20(2).png) +![ss2](./img/Screenshot%20(3).png) +![ss3](./img/Screenshot%20(4).png) + +
+ +## **Working video 📹** + \ No newline at end of file diff --git a/Games/Otherworldly_Odyssey/img/23.png b/Games/Otherworldly_Odyssey/img/23.png new file mode 100644 index 0000000000..363ee76432 Binary files /dev/null and b/Games/Otherworldly_Odyssey/img/23.png differ diff --git a/Games/Otherworldly_Odyssey/img/Screenshot (2).png b/Games/Otherworldly_Odyssey/img/Screenshot (2).png new file mode 100644 index 0000000000..b9083f0dce Binary files /dev/null and b/Games/Otherworldly_Odyssey/img/Screenshot (2).png differ diff --git a/Games/Otherworldly_Odyssey/img/Screenshot (3).png b/Games/Otherworldly_Odyssey/img/Screenshot (3).png new file mode 100644 index 0000000000..a800e7e6ff Binary files /dev/null and b/Games/Otherworldly_Odyssey/img/Screenshot (3).png differ diff --git a/Games/Otherworldly_Odyssey/img/Screenshot (4).png b/Games/Otherworldly_Odyssey/img/Screenshot (4).png new file mode 100644 index 0000000000..0b9d520df8 Binary files /dev/null and b/Games/Otherworldly_Odyssey/img/Screenshot (4).png differ diff --git a/Games/Otherworldly_Odyssey/index.html b/Games/Otherworldly_Odyssey/index.html new file mode 100644 index 0000000000..d43a47799c --- /dev/null +++ b/Games/Otherworldly_Odyssey/index.html @@ -0,0 +1,38 @@ + + + + + + + Otherworldly Odyssey + + + +

Otherworldly Odyssey

+ +
+ +
+ XP: 0 + Health: 1000 + Gold: 50 +
+ +
+ Monster Name: + Health: +
+ +
+ Welcome to Otherworldly Odyssey. You must defeat the primordial dragon - Tiamut that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons below. +
+ +
+ + + +
+
+ + + \ No newline at end of file diff --git a/Games/Otherworldly_Odyssey/script.js b/Games/Otherworldly_Odyssey/script.js new file mode 100644 index 0000000000..d6ffcc210c --- /dev/null +++ b/Games/Otherworldly_Odyssey/script.js @@ -0,0 +1,308 @@ +// Initialize game variables +let xp = 0; +let health = 1000; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["Arondight"]; + +// Select DOM elements +const button1 = document.querySelector('#button1'); +const button2 = document.querySelector("#button2"); +const button3 = document.querySelector("#button3"); +const text = document.querySelector("#text"); +const xpText = document.querySelector("#xpText"); +const healthText = document.querySelector("#healthText"); +const goldText = document.querySelector("#goldText"); +const monsterStats = document.querySelector("#monsterStats"); +const monsterName = document.querySelector("#monsterName"); +const monsterHealthText = document.querySelector("#monsterHealth"); + +// Define weapons +const weapons = [ + { name: 'Arondight', power: 50 }, + { name: 'Excalibur', power: 100 }, + { name: 'Rhongomiant', power: 200 }, + { name: 'Durendal', power: 350 }, + { name: 'Gáe Bulg', power: 550 }, + { name: 'Kusanagi', power: 800 }, + { name: 'Ru Yi Jing Gu Bang', power: 1100 }, + { name: 'Mjölnir', power: 1450 }, + { name: 'The Sword of Surtr', power: 1850 }, + { name: "Gungnir - Odin's spear", power: 2300 }, +]; + +// Define monsters +const monsters = [ + { + name: "Basilisk", + level: 20, + health: 300 + }, + { + name: "Yamata no Orochi", + level: 160, + health: 1200 + }, + { + name: "Tiamat - Primordial Dragon", + level: 800, + health: 9600 + } +] + +// Define game locations +const locations = [ + { + name: "town square", + "button text": ["Go to store", "Go to cave", "Fight Tiamat"], + "button functions": [goStore, goCave, fightTiamat], + text: "You are in the town square. You see a sign that says \"Store\"." + }, + { + name: "store", + "button text": ["Buy 10 health (10 gold)", "Buy weapon (30 gold)", "Go to town square"], + "button functions": [buyHealth, buyWeapon, goTown], + text: "You enter the store." + }, + { + name: "cave", + "button text": ["Fight Basilisk", "Fight Yamata no Orochi", "Go to town square"], + "button functions": [fightBasilisk, fightYamata, goTown], + text: "You enter the cave. You see some monsters." + }, + { + name: "fight", + "button text": ["Attack", "Dodge", "Run"], + "button functions": [attack, dodge, goTown], + text: "You are fighting a monster." + }, + { + name: "kill monster", + "button text": ["Go to town square", "Go to town square", "Go to town square"], + "button functions": [goTown, goTown, easterEgg], + text: 'The monster screams "Arg!" as it dies. You gain experience points and find gold.' + }, + { + name: "lose", + "button text": ["REPLAY?", "REPLAY?", "REPLAY?"], + "button functions": [restart, restart, restart], + text: "You die. ☠" + }, + { + name: "win", + "button text": ["REPLAY?", "REPLAY?", "REPLAY?"], + "button functions": [restart, restart, restart], + text: "You defeat the Great Tiamat! YOU WIN THE GAME! 🎉" + }, + { + name: "easter egg", + "button text": ["2", "8", "Go to town square?"], + "button functions": [pickTwo, pickEight, goTown], + text: "You find a secret game. Pick a number above. Ten numbers will be randomly chosen between 0 and 10. If the number you choose matches one of the random numbers, you win!" + } +]; + +// Initialize button click handlers +button1.onclick = goStore; +button2.onclick = goCave; +button3.onclick = fightTiamat; + +// Function to update game state based on location +function update(location) { + monsterStats.style.display = "none"; + button1.innerText = location["button text"][0]; + button2.innerText = location["button text"][1]; + button3.innerText = location["button text"][2]; + button1.onclick = location["button functions"][0]; + button2.onclick = location["button functions"][1]; + button3.onclick = location["button functions"][2]; + text.innerHTML = location.text; +} + +// Navigation functions +function goTown() { + update(locations[0]); +} + +function goStore() { + update(locations[1]); +} + +function goCave() { + update(locations[2]); +} + +// Store functions +function buyHealth() { + if (gold >= 10) { + gold -= 10; + health += 500; + goldText.innerText = gold; + healthText.innerText = health; + } else { + text.innerText = "You do not have enough gold to buy health."; + } +} + +function buyWeapon() { + if (currentWeapon < weapons.length - 1) { + if (gold >= 30) { + gold -= 30; + currentWeapon++; + goldText.innerText = gold; + let newWeapon = weapons[currentWeapon].name; + text.innerText = "You now have a " + newWeapon + "."; + inventory.push(newWeapon); + text.innerText += " In your inventory you have: " + inventory; + } else { + text.innerText = "You do not have enough gold to buy a weapon."; + } + } else { + text.innerText = "You already have the most powerful weapon!"; + button2.innerText = "Sell weapon for 15 gold"; + button2.onclick = sellWeapon; + } +} + +function sellWeapon() { + if (inventory.length > 1) { + gold += 15; + goldText.innerText = gold; + let currentWeapon = inventory.shift(); + text.innerText = "You sold a " + currentWeapon + "."; + text.innerText += " In your inventory you have: " + inventory; + } else { + text.innerText = "Don't sell your only weapon!"; + } +} + +// Combat functions +function fightBasilisk() { + fighting = 0; + goFight(); +} + +function fightYamata() { + fighting = 1; + goFight(); +} + +function fightTiamat() { + fighting = 2; + goFight(); +} + +function goFight() { + update(locations[3]); + monsterHealth = monsters[fighting].health; + monsterStats.style.display = "block"; + monsterName.innerText = monsters[fighting].name; + monsterHealthText.innerText = monsterHealth; +} + +function attack() { + text.innerText = "The " + monsters[fighting].name + " attacks."; + text.innerText += " You attack it with your " + weapons[currentWeapon].name + "."; + health -= getMonsterAttackValue(monsters[fighting].level); + if (isMonsterHit()) { + monsterHealth -= weapons[currentWeapon].power + Math.floor(Math.random() * xp) + 1; + } else { + text.innerText += " You miss."; + } + healthText.innerText = health; + monsterHealthText.innerText = monsterHealth; + if (health <= 0) { + lose(); + } else if (monsterHealth <= 0) { + if (fighting === 2) { + winGame(); + } else { + defeatMonster(); + } + } + if (Math.random() <= .1 && inventory.length !== 1) { + text.innerText += " Your " + inventory.pop() + " breaks."; + currentWeapon--; + } +} + +function getMonsterAttackValue(level) { + const hit = (level * 5) - (Math.floor(Math.random() * xp)); + console.log(hit); + return hit > 0 ? hit : 0; +} + +function isMonsterHit() { + return Math.random() > .2 || health < 20; +} + +function dodge() { + text.innerText = "You dodge the attack from the " + monsters[fighting].name; +} + +function defeatMonster() { + gold += Math.floor(monsters[fighting].level * 6.7); + xp += monsters[fighting].level; + goldText.innerText = gold; + xpText.innerText = xp; + update(locations[4]); +} + +// Game end states +function lose() { + update(locations[5]); +} + +function winGame() { + update(locations[6]); +} + +function restart() { + xp = 0; + health = 1000; + gold = 50; + currentWeapon = 0; + inventory = ["Arondight"]; + goldText.innerText = gold; + healthText.innerText = health; + xpText.innerText = xp; + goTown(); +} + +// Easter egg mini-game +function easterEgg() { + update(locations[7]); +} + +function pickTwo() { + pick(2); +} + +function pickEight() { + pick(8); +} + +function pick(guess) { + const numbers = []; + while (numbers.length < 10) { + numbers.push(Math.floor(Math.random() * 11)); + } + text.innerText = "You picked " + guess + ". Here are the random numbers:\n"; + for (let i = 0; i < 10; i++) { + text.innerText += numbers[i] + "\n"; + } + if (numbers.includes(guess)) { + text.innerText += "Right! You win 20 gold!"; + gold += 20; + goldText.innerText = gold; + } else { + text.innerText += "Wrong! You lose 10 health!"; + health -= 10; + healthText.innerText = health; + if (health <= 0) { + lose(); + } + } +} \ No newline at end of file diff --git a/Games/Otherworldly_Odyssey/style.css b/Games/Otherworldly_Odyssey/style.css new file mode 100644 index 0000000000..ebc77aa11b --- /dev/null +++ b/Games/Otherworldly_Odyssey/style.css @@ -0,0 +1,157 @@ +/* Global body styles */ +body { + margin: 0; + padding: 0; + min-height: 100vh; + background-color: #0a0a23; + background-image: url('img/23.png'); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + background-attachment: fixed; + font-size: 16px; + } + +/* Game text area styles */ +#text { + background-color: rgba(10, 10, 35, 0.5); + color: #ffffff; + padding: 10px; + } + +/* Main game container styles */ +#game { + max-width: 90%; /* Responsive width */ + max-height: none; /* Remove max-height */ + margin: 20px auto; + padding: 10px; + background-color: rgba(0, 0, 10, 0); + } + +/* Styles for controls and stats sections */ +#controls, +#stats { + border: 1px solid #0a0a23; + padding: 5px; + color: #0a0a23; + background-color: rgba(0, 0, 10, 0.5); + } + +/* Control buttons layout */ +#controls { + display: flex; + justify-content: space-between; + padding: 10px; + flex-direction: column; /* Stack buttons vertically on mobile */ + gap: 10px; /* Add space between buttons */ + } + +/* Monster stats section styles */ +#monsterStats { + display: none; + border: 1px solid #0a0a23; + padding: 5px; + color: #ffffff; + background-color: #c70d0d; + } + +/* Individual stat styling */ +.stat { + padding-right: 10px; + } + +/* Button styles */ +button { + cursor: pointer; + color: #0a0a23; + background-color: #feac32; + background-image: linear-gradient(#fecc4c, #ffac33); + border: 3px solid #feac32; + border-radius: 20px; + cursor: pointer; + transition: box-shadow 0.3s ease-in-out, transform 0.1s ease-in-out; + width: 100%; /* Full width buttons */ + padding: 10px; /* Larger touch target */ + font-size: 1em; /* Relative font size */ + } + +/* Button hover effect */ +button:hover { + box-shadow: 0 0 15px 5px rgba(255, 165, 0, 0.7); /* Glow effect */ + transform: scale(1.05); /* Slightly increase size on hover */ +} + +/* Centering utility class */ +.centered-div { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + +/* Gradient text effect for title */ +.gradient-text { + font-size: 2em; /* Relative font size */ + font-weight: bold; + background: linear-gradient( + to right, + #4285F4, /* Blue */ + #f4009f, /* Pink */ + #DB4437, /* Red */ + #5d0f9d, /* Purple */ + #4285F4 /* Blue again to loop smoothly */ + ); + -webkit-background-clip: text; + background-clip: text; + color: transparent; + background-size: 200% auto; + animation: gradient-animation 10s linear infinite; + text-align: center; + } + +/* Keyframes for gradient animation */ +@keyframes gradient-animation { + 0% { + background-position: 0% center; + } + 100% { + background-position: -200% center; + } + } + +/* XP stat styling */ +.xpStat { + color:#8c00ff; + text-shadow: 0 0 10px #8c00ff, 0 0 20px #8c00ff, 0 0 30px #8c00ff, 0 0 40px #ff00de, 0 0 70px #ff00de, 0 0 80px #ff00de, 0 0 100px #ff00de, 0 0 150px #ff00de; + } + +/* Health stat styling */ +.healthStat { + color: #ff0000 ; + text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000, 0 0 40px #ff00de, 0 0 70px #ff00de, 0 0 80px #ff00de, 0 0 100px #ff00de, 0 0 150px #ff00de; + } + +/* Gold stat styling */ +.goldStat { + color: #FFD300; + text-shadow: 0 0 10px #FFD300, 0 0 20px #FFD300, 0 0 30px #FFD300, 0 0 40px #ff00de, 0 0 70px #ff00de, 0 0 80px #ff00de, 0 0 100px #ff00de, 0 0 150px #ff00de; + } + +/* Media query for larger screens */ +@media screen and (min-width: 768px) { + #game { + max-width: 500px; + } + + #controls { + flex-direction: row; + } + + button { + width: auto; + } + + .gradient-text { + font-size: 48px; + } +} \ No newline at end of file diff --git a/README.md b/README.md index 6481bc9a82..b58bff8ded 100644 --- a/README.md +++ b/README.md @@ -484,6 +484,10 @@ This repository also provides one such platforms where contributers come over an + + +======= + | Game | Game | Game | Game | Game | | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | --- | @@ -793,6 +797,13 @@ This repository also provides one such platforms where contributers come over an |[Pattern Creation Game](https://github.com/kunjgit/GameZone/tree/main/Games/Pattern_Creation_Game)| [Magic_8_ball_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Magic_8_ball) | | [Catch_Craze](https://github.com/kunjgit/GameZone/tree/main/Games/Catch_Craze) | + + +======= +| [Angry_Bird](https://github.com/kunjgit/GameZone/tree/main/Games/Angry_Bird) | + +======= + | [UNO game with computer](https://github.com/kunjgit/GameZone/tree/main/Games/UNO_game_with_Computer) | |[Dice_Rolling_Simulator](https://github.com/priyashuu/GameZone/tree/main/Games/Dice_rolling_simulator)| |[Space_Dominators](https://github.com/kunjgit/GameZone/tree/main/Games/Space_Dominators)| @@ -801,8 +812,16 @@ This repository also provides one such platforms where contributers come over an |[Five_Nights_at_Freddys](https://github.com/kunjgit/GameZone/tree/main/Games/Five_Nights_at_Freddys)| |[Matching_Pair](https://github.com/kunjgit/GameZone/tree/main/Games/Matching_pair) +|[Otherworldly_Odyssey](./Games/Otherworldly_Odyssey/)| + + + +======= + + +======= ======= | [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [TriHand_Tactics](https://github.com/kunjgit/GameZone/tree/main/Games/TriHand_Tactics) | [Earth_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Earth_Guardian) | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [CatchTheBall](https://github.com/kunjgit/GameZone/tree/main/Games/CatchTheBall) | [Colour_Generator_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Colour_Generator_Game) | | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | [Mancala_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Mancala_Game) | [2048_win](https://github.com/kunjgit/GameZone/tree/main/Games/2048_win) | [Dice_Roller](https://github.com/kunjgit/GameZone/tree/main/Games/Dice_Roller) | [Chrome_Dino_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Chrome_Dino_Game) | @@ -1586,6 +1605,7 @@ This repository also provides one such platforms where contributers come over an +
diff --git a/assets/images/Otherworldy_Odyssey.png b/assets/images/Otherworldy_Odyssey.png new file mode 100644 index 0000000000..b9083f0dce Binary files /dev/null and b/assets/images/Otherworldy_Odyssey.png differ