diff --git a/Games/Ant_Smasher/Readme.md b/Games/Ant_Smasher/Readme.md new file mode 100644 index 0000000000..7551ca027f --- /dev/null +++ b/Games/Ant_Smasher/Readme.md @@ -0,0 +1,20 @@ +# **Game_Name** + +Ant Smasher + +## **Description 📃** + +Frontend game developed using HTML, CSS, JavaScript. Player has to kill all the Ants + +## **functionalities 🎮** + +- Player has to kill all the Ants by Smashing it. + +## **How to play? 🕹️** + +- Click the Start button to start the game +- When players hits the ant the score will get increased. + +## **Screenshots 📸** + +![alt text](./img/image.png) diff --git a/Games/Ant_Smasher/index.html b/Games/Ant_Smasher/index.html new file mode 100644 index 0000000000..6bd4b1f777 --- /dev/null +++ b/Games/Ant_Smasher/index.html @@ -0,0 +1,37 @@ + + + + + Ant Smasher Game + + + + + +

Ant Smasher0

+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/Games/Ant_Smasher/script.js b/Games/Ant_Smasher/script.js new file mode 100644 index 0000000000..6f02773bf5 --- /dev/null +++ b/Games/Ant_Smasher/script.js @@ -0,0 +1,47 @@ +const holes = document.querySelectorAll(".hole"); +const scoreBoard = document.querySelector(".score"); +const moles = document.querySelectorAll(".mole"); +let lastHole; +let timeUp = false; +let score = 0; + +function randomTime(min, max) { + return Math.round(Math.random() * (max - min) + min); +} + +function randomHole(holes) { + const idx = Math.floor(Math.random() * holes.length); + const hole = holes[idx]; + if (hole === lastHole) { + return randomHole(holes); + } + lastHole = hole; + return hole; +} + +function peep() { + const time = randomTime(500, 2000); + const hole = randomHole(holes); + hole.classList.add("up"); + setTimeout(() => { + hole.classList.remove("up"); + if (!timeUp) peep(); + }, time); +} + +function startGame() { + scoreBoard.textContent = 0; + timeUp = false; + score = 0; + peep(); + setTimeout(() => (timeUp = true), 10000); +} + +function bonk(e) { + if (!e.isTrusted) return; // cheater! + score++; + this.parentNode.classList.remove("up"); + scoreBoard.textContent = score; +} + +moles.forEach((mole) => mole.addEventListener("click", bonk)); diff --git a/Games/Ant_Smasher/style.css b/Games/Ant_Smasher/style.css new file mode 100644 index 0000000000..494f974094 --- /dev/null +++ b/Games/Ant_Smasher/style.css @@ -0,0 +1,72 @@ +html { + box-sizing: border-box; + font-size: 10px; + background: #9b7653; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +body { + padding: 0; + margin: 0; + font-family: "Amatic SC", cursive; +} + +h1 { + text-align: center; + font-size: 10rem; + line-height: 1; + margin-bottom: 0; +} + +.score { + background: rgba(255, 255, 255, 0.2); + padding: 0 3rem; + line-height: 1; + border-radius: 1rem; +} + +.game { + width: 600px; + height: 400px; + display: flex; + flex-wrap: wrap; + margin: 0 auto; +} + +.hole { + flex: 1 0 33.33%; + overflow: hidden; + position: relative; +} + +.hole:after { + display: block; + background: url(../../assets/images/Ant_Smasher_dirt.svg) bottom center + no-repeat; + background-size: contain; + content: ""; + width: 100%; + height: 70px; + position: absolute; + z-index: 2; + bottom: -30px; +} + +.mole { + background: url("../../assets/images/Ant_Smasher.png") bottom center no-repeat; + background-size: 60%; + position: absolute; + top: 100%; + width: 100%; + height: 100%; + transition: all 0.4s; +} + +.hole.up .mole { + top: 0; +} diff --git a/README.md b/README.md index 188d62c5e3..82e99381dc 100644 --- a/README.md +++ b/README.md @@ -591,7 +591,7 @@ This repository also provides one such platforms where contributers come over an | [Mastermind_Mania](https://github.com/kunjgit/GameZone/tree/main/Games/Mastermind_Mania) | [Ludo_4_Player](https://github.com/kunjgit/GameZone/tree/main/Games/Ludo_4_Player) | [AirBalloon](https://github.com/kunjgit/GameZone/tree/main/Games/AirBalloon) | [Space Invaders](https://github.com/kunjgit/GameZone/tree/main/Games/Space_Invaders) | [Cut the Rope](https://github.com/kunjgit/GameZone/tree/main/Games/Cut_the_rope) | | [Caesar&Cipher](https://github.com/kunjgit/GameZone/tree/main/Games/Caesar_Cipher) | [Monster_Maker](https://github.com/kunjgit/GameZone/tree/main/Games/Monster_Maker) | [Stolen Sword](https://github.com/kunjgit/GameZone/tree/main/Games/Stolen_Sword) | [Mastermind](https://github.com/kunjgit/GameZone/tree/main/Games/Mastermind) | [Highway 404](https://github.com/kunjgit/GameZone/tree/main/Games/Highway_404) | | [BullseyeGame](https://github.com/kunjgit/GameZone/tree/main/Games/BullseyeGame) | [Crossword Game](https://github.com/kunjgit/GameZone/tree/main/Games/Crossword_Game) | [Guess the Correct Logo](https://github.com/shruti-2412/GameZone/tree/main/Games/Guess_The_Correct_Logo) | [Painting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Painting_Game) | [Platform_game_engine](https://github.com/kunjgit/GameZone/tree/main/Games/Platform_game_engine) | -| [Kill_The_Bird](https://github.com/kunjgit/GameZone/tree/main/Games/Kill_The_Bird) | +| [Kill_The_Bird](https://github.com/kunjgit/GameZone/tree/main/Games/Kill_The_Bird) | | [Doppelkopf](https://github.com/kunjgit/GameZone/tree/main/Games/Doppelkopf) | [quiz_game](https://github.com/kunjgit/GameZone/tree/main/Games/quiz_game) | [Island Survival](https://github.com/kunjgit/GameZone/tree/main/Games/Island_Survival) | [Linkup Game](https://github.com/kunjgit/GameZone/tree/main/Games/linkup) | [Trivia_Card](https://github.com/kunjgit/GameZone/tree/main/Games/Trivia_Card) | | [Insect Catch Game](https://github.com/kunjgit/GameZone/tree/main/Games/Insect_Catch_Game) | [Carnival_game](https://github.com/kunjgit/GameZone/tree/main/Games/Carnival_game) | [Make Me Laugh](https://github.com/kunjgit/GameZone/tree/main/Games/Make_Me_Laugh) | [Avoider_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Avoider_Game) | [Dungeon_Crawler](https://github.com/kunjgit/GameZone/tree/main/Games/Dungeon_Crawler) | | [snake_water_gun](https://github.com/kunjgit/GameZone/tree/main/Games/snake_water_gun) | [Run and Jump](https://github.com/kunjgit/GameZone/tree/main/Games/Run_and_Jump) | [AI CHESS Game](https://github.com/kunjgit/GameZone/tree/main/Games/AI_CHESS_Game) | [Fruit_Catching](https://github.com/kunjgit/GameZone/tree/main/Games/Fruit_Catching) | [Bulls eye](https://github.com/kunjgit/GameZone/tree/main/Games/Bulls_eye) | @@ -626,10 +626,10 @@ This repository also provides one such platforms where contributers come over an | [CSS Select](https://github.com/kunjgit/GameZone/tree/main/Games/CSS_Select) | [Squid](https://github.com/kunjgit/GameZone/tree/main/Games/Squid_Game) | [Flip Coin](https://github.com/kunjgit/GameZone/tree/main/Games/Flip_Coin) | [Witty Word Quest](https://github.com/kunjgit/GameZone/tree/main/Games/witty_word_quest) | [Typing Game](https://github.com/Ishan-77/GameZone/tree/main/Games/Typing_Game) | | [numeral-whiz](https://github.com/Ishan-77/GameZone/tree/main/Games/numeral-whiz) | [candy_match](https://github.com/kunjgit/GameZone/tree/main/Games/Candy_Match_Saga) | [Crossy_Road](https://github.com/tanujbordikar/GameZone/tree/Crossy_Road) | [HueHero](https://github.com/kunjgit/GameZone/tree/main/Games/HueHero) | [Puzzel_Winner](https://github.com/kunjgit/GameZone/tree/main/Games/Puzzel_Winner) | | [Emoji_Intruder](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Intruder) | [Guess The Weapon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Weapon) | [Guess Who](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_Who) | [Pop My Balloon](https://github.com/kunjgit/GameZone/tree/main/Games/Pop_My_Balloon) | [Color_Blast](https://github.com/kunjgit/GameZone/tree/main/Games/Color_Blast) | +| [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Coloron](https://github.com/kunjgit/GameZone/tree/main/Games/Coloron). | [Wordling](https://github.com/kunjgit/GameZone/tree/main/Games/Wordling) | [HTML5_Controller_Tester](https://github.com/kunjgit/GameZone/tree/main/Games/HTML5_Controller_Tester) -| [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Coloron](https://github.com/kunjgit/GameZone/tree/main/Games/Coloron). | [Spirograph](https://github.com/kunjgit/GameZone/tree/main/Games/Spirograph) | -| [Black_jackk](https://github.com/kunjgit/GameZone/tree/main/Games/Black_jackk) | [Audio_Wordle](https://github.com/kunjgit/GameZone/tree/main/Games/Audio_Wordle) +| [Black_jackk](https://github.com/kunjgit/GameZone/tree/main/Games/Black_jackk) | [Audio_Wordle](https://github.com/kunjgit/GameZone/tree/main/Games/Audio_Wordle>>>>>>> main | [Earth_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Earth_Guardian) | | [escaperoom](https://github.com/kunjgit/GameZone/tree/main/Games/escaperoom) | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [HTML5_Controller_Tester](https://github.com/kunjgit/GameZone/tree/main/Games/HTML5_Controller_Tester) @@ -637,11 +637,11 @@ This repository also provides one such platforms where contributers come over an | [Tower Stack](https://github.com/kunjgit/GameZone/tree/main/Games/Tower_Stack) | | [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) | | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [CatchTheBall](https://github.com/kunjgit/GameZone/tree/main/Games/CatchTheBall) | -| [CopyCat](https://github.com/kunjgit/GameZone/tree/main/Games/CopyCat) | +| [CopyCat](https://github.com/kunjgit/GameZone/tree/main/Games/CopyCat) | | [Cross_The_River_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Cross_The_River_Game) | [DoraemonRun ](https://github.com/kunjgit/GameZone/tree/main/Games/DoraemonRun) | | [Memory_Cards_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Memory_Cards_Game) | -| [Typing_Speed_Test2](https://github.com/kunjgit/GameZone/tree/main/Games/Typing_Speed_Test2) | [Tic Tac Toe Responsive ](https://github.com/kunjgit/GameZone/tree/main/Games/Tic_tac_toe_responsive) | [Minesweeper Easy ](https://github.com/kunjgit/GameZone/tree/main/Games/MineSweeper_Easy) | +| [Typing_Speed_Test2](https://github.com/kunjgit/GameZone/tree/main/Games/Typing_Speed_Test2) | [Tic Tac Toe Responsive ](https://github.com/kunjgit/GameZone/tree/main/Games/Tic_tac_toe_responsive) | [Minesweeper Easy ](https://github.com/kunjgit/GameZone/tree/main/Games/MineSweeper_Easy) | | [Technical_Mind_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Technical_Mind_Game) | [Slide_Master_Puzzle](https://github.com/kunjgit/GameZone/tree/Main/Games/Slide_Master_Puzz)| | | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [Letter_Sleuth](https://github.com/swetha5157/GameZone/tree/main/Games/Letter_Sleuth) @@ -773,23 +773,22 @@ This repository also provides one such platforms where contributers come over an | [Sudoku_light_theme](https://github.com/kunjgit/GameZone/tree/main/Games/Sudoku_light_theme) | | [Find_the_ball](https://github.com/kunjgit/GameZone/tree/main/Games/Find_the_ball) | |[Color The Page](https://github.com/kunjgit/GameZone/tree/main/Games/Color_The_Page)| +|[Lunar Lander](https://github.com/kunjgit/GameZone/tree/main/Games/Lunar_Lander)| +|[AquaSort_Game](https://github.com/kunjgit/GameZone/tree/main/Games/AquaSort_Game) | +|[Chess_Game_computer](https://github.com/kunjgit/GameZone/tree/main/Games/Chess_Game_computer) | +|[Turn_on_the_light](https://github.com/kunjgit/GameZone/tree/main/Games/Turn_on_the_light) | |[AquaSort_Game](https://github.com/kunjgit/GameZone/tree/main/Games/AquaSort_Game) | -| [Snake](https://github.com/kunjgit/GameZone/tree/main/Games/snake)                | | [whack a mole](https://github.com/kunjgit/GameZone/tree/main/Games/whack%20a%20mole) | -|[AquaSort_Game](https://github.com/kunjgit/GameZone/tree/main/Games/AquaSort_Game) | | [Snake](https://github.com/kunjgit/GameZone/tree/main/Games/snake)                | | [Dice_Game] (https://github.com/shivan2004/GameZone/tree/main/Games/Dice_Game)| |[HitOrMiss](https://github.com/kunjgit/GameZone/tree/main/Games/HitOrMiss)| -|[Lunar Lander](https://github.com/kunjgit/GameZone/tree/main/Games/Lunar_Lander)| -|[AquaSort_Game](https://github.com/kunjgit/GameZone/tree/main/Games/AquaSort_Game) | -| [Snake](https://github.com/kunjgit/GameZone/tree/main/Games/snake)                | | [Tetris Game](https://github.com/kunjgit/GameZone/tree/main/Games/tetris_game)| -|[Chess_Game_computer](https://github.com/kunjgit/GameZone/tree/main/Games/Chess_Game_computer) | |[Turn_on_the_light](https://github.com/kunjgit/GameZone/tree/main/Games/Turn_on_the_light) | | [Tic-Tac-Toe Game](https://github.com/kunjgit/GameZone/tree/main/Games/Tic-Tac-Toe) | | [Bubble'z Popper](https://github.com/Chandu6702/GameZone/tree/main/Games/Bubble'z Popper)| | [Dsa_quiz_game](https://github.com/kunjgit/GameZone/tree/main/Games/Dsa_quiz_game) | | [Gravity_Simulation_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Gravity_Simulation_Game) | + | [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) | [Catch_The_Ball](https://github.com/kunjgit/GameZone/tree/main/Games/Catch_The_Ball) | | [Ball_in_Maze](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_in_Maze) | @@ -797,8 +796,9 @@ This repository also provides one such platforms where contributers come over an | [Gravity_Simulation_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Gravity_Simulation_Game) | [Anagarm-Word-Game](https://github.com/kunjgit/GameZone/tree/main/Games/Anagarm-Word-Game) | | [Brick Buster Game](https://github.com/kunjgit/GameZone/tree/main/Games/Brick Buster) | +| [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) +======= | [SnakeBites](https://github.com/kunjgit/GameZone/tree/main/Games/SnakeBites) | -| [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) | [Alphabet-and-Vowels](https://github.com/kunjgit/GameZone/tree/main/Games/Alphabet-and-Vowels) | | [Brick Buster Game](https://github.com/kunjgit/GameZone/tree/main/Games/Brick%20Buster) | | [Penguins Can't Fly](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Penguins_Can't_Fly) | @@ -811,8 +811,8 @@ This repository also provides one such platforms where contributers come over an | [Modulo_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Modulo_Game) | | [Memory_Matching_Game](https://github.com/Saipradyumnagoud/GameZone/tree/main/Games/Memory_Matching_Game) | |[Penguins Can't Fly](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Penguins_Can't_Fly)| -| [Block_Ninja] (https://github.com/kunjgit/GameZone/tree/main/Games/Block_Ninja) | -| [Shoot_Duck_Game] (https://github.com/kunjgit/GameZone/tree/main/Games/Shoot_Duck_Game) | +| [Block_Ninja] (https://github.com/kunjgit/GameZone/tree/main/Games/Block_Ninja) | +| [Shoot_Duck_Game] (https://github.com/kunjgit/GameZone/tree/main/Games/Shoot_Duck_Game) | | [Disney_Trivia](https://github.com/manmita/GameZone/tree/Disney_Trivia/Games/Disney_Trivia)| |[puzzle-game](https://github.com/kunjgit/GameZone/tree/main/Games/puzzle-game)| | [Helicopter_Game](https://github.com/kinjgit/GameZone/tree/main/Games/Helicopter_Game) | @@ -823,7 +823,7 @@ This repository also provides one such platforms where contributers come over an |[Math_Race_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Math_Race_Game)| | [Bunny is Lost](https://github.com/kunjgit/GameZone/tree/main/Games/Bunny_is_Lost)| |[Steam_Punk](https://github.com/kunjgit/GameZone/tree/main/Games/Steam_Punk)| -|[Tower Defence Game](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Tower_Defence_Game)| +|[Tower Defence Game](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Tower_Defence_Game) | | [Ant Smasher Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ant_Smasher)| |[Mario Matching Game](https://github.com/ananyag309/GameZone_ggsoc/tree/main/Games/MarioMatchingGame)| |[Dot_Dash](https://github.com/kunjgit/GameZone/tree/main/Games/Dot_Dash)| |[Ghost Busting Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ghost_busting_game)| diff --git a/assets/images/Ant_Smasher.png b/assets/images/Ant_Smasher.png new file mode 100644 index 0000000000..285dc8e823 Binary files /dev/null and b/assets/images/Ant_Smasher.png differ diff --git a/assets/images/Ant_Smasher_Demo.png b/assets/images/Ant_Smasher_Demo.png new file mode 100644 index 0000000000..a127f970f5 Binary files /dev/null and b/assets/images/Ant_Smasher_Demo.png differ diff --git a/assets/images/Ant_Smasher_dirt.svg b/assets/images/Ant_Smasher_dirt.svg new file mode 100644 index 0000000000..8726a9ec71 --- /dev/null +++ b/assets/images/Ant_Smasher_dirt.svg @@ -0,0 +1,40 @@ + + + + dirt + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file