diff --git a/README.md b/README.md index 3dd9c751..aac880e8 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ Happy coding! | [Roulette Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Roulette%20Game) | [RSS Finder](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/RSS%20Finder) | [Ruby Code Editor](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Ruby%20Code%20Editor) | [Screen Pet Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Screen%20Pet%20Game) | [Screenshot Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Screenshot%20Extension) | | [Scroll To Top](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Scroll%20To%20Top) | [Shoe Size Checker](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Shoe%20Size%20Checker) | [Shoot Duck Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Shoot%20Duck%20Game) | [Shopping Cart Saver](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Shopping%20Cart%20Saver) | [ShrekVsWild Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/ShrekVsWild%20Game) | | [ShroomKnight](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/ShroomKnight) | [Simon Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Simon%20Game) | [Simple Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Simple%20Extension) | [Simple Intrest Calculator](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Simple%20Intrest%20Calculator) | [Smart Shopping Assistant](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Smart%20Shopping%20Assistant) | -| [Smashing Blocks](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Smashing%20Blocks) | [Snake game Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Snake%20game%20Extension) | [Social Media Limiter](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Social%20Media%20Limiter) | [Song By Word Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Song%20By%20Word%20Extension) | [Song Tracker](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Song%20Tracker) | +| [Smashing Blocks](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Smashing%20Blocks) | [Snake game Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Snake%20game%20Extension) | [Snake Water Gun ](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Snake%20Water%20Gun) | [Social Media Limiter](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Social%20Media%20Limiter) | [Song By Word Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Song%20By%20Word%20Extension) | [Song Tracker](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Song%20Tracker) | | [Sound Booster Extension](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Sound%20Booster%20Extension) | [Space Adventure](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Space%20Adventure) | [Space Dominator](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Space%20Dominator) | [Space Invader](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Space%20Invader) | [Space Shooter](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Space%20Shooter) | | [Spline](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Spline) | [Squid Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Squid%20Game) | [Stand Up](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Stand%20Up) | [Steam Punk](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Steam%20Punk) | [Stick Hero With Canvas Game](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Stick%20Hero%20With%20Canvas%20Game) | | [Stock Price Tracker](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Stock%20Price%20Tracker) | [Stock Trading](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Stock%20Trading) | [Stopwatch](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Stopwatch) | [Stress Management Tips](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/Stress%20Management%20Tips) | [String Integer](https://github.com/Sulagna-Dutta-Roy/GGExtensions/tree/master/String%20Integer) | diff --git a/Snake Water Gun/composer.json b/Snake Water Gun/composer.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/Snake Water Gun/composer.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/Snake Water Gun/index.html b/Snake Water Gun/index.html new file mode 100644 index 00000000..cb1694ce --- /dev/null +++ b/Snake Water Gun/index.html @@ -0,0 +1,83 @@ + + + + + + + Snake Water and Gun Game + + + + + + + + + +
+
+
+
+
System
+
00
+
+
+
Round
+
00/00
+
+
+
You
+
00
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+

system

+
+
+ +
+
+
+

You

+
+
+
+

What you want to make ?

+
+
+ snake +

Snake

+
+
+ water +

Water

+
+
+ gun +

Gun

+
+
+
+
+ +
+

About Game

+

In this game you have to choose between snake,water and gun. Snake kills the water, water kills the gun and gun kills the snake. In this game winner will get 1 point. if both choose the same then both will get 1 points. in total of 10 rounds who + gets the highest points will be considered as winner.

let's check how lucky you are, have fun.

Your feedback is vaued for us to improve and develop more better applications.

+
+ + + + \ No newline at end of file diff --git a/Snake Water Gun/index.php b/Snake Water Gun/index.php new file mode 100644 index 00000000..df8c417a --- /dev/null +++ b/Snake Water Gun/index.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Snake Water Gun/static/css/swg.css b/Snake Water Gun/static/css/swg.css new file mode 100644 index 00000000..fd93a445 --- /dev/null +++ b/Snake Water Gun/static/css/swg.css @@ -0,0 +1,259 @@ +* { + padding: 0; + margin: 0; + box-sizing: border-box; +} + +.flex { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +#scoreBoard { + display: flex; + height: 10vh; + padding: 5px; + background-color: rgb(185, 182, 1); + text-align: center; + justify-content: center; +} + +.board p { + margin: 0px; + padding: 0; + width: 100%; + height: max-content; + text-align: center; +} + +.board { + width: 80%; + overflow: auto; + height: 8vh; + align-items: center; + justify-content: center; + background-color: white; + font-size: 3vh; + margin: 10px; + border-radius: 30px; +} + + +/* -----END of score board section ----- */ + +#area { + padding: 5px; + border: 10px solid maroon; + background-color: rgb(255, 254, 254); +} + +#warArea { + align-items: center; + background-color: whitesmoke; + height: 45vh; +} + +#msg { + justify-content: center; +} + +#msg p { + border: 4px solid black; + background-color: white; + border-radius: 80px 80px 0 80px; + padding: 25px; + margin: 40px; + text-align: center; + font-size: 4vh; +} + +#result { + box-sizing: content-box; + margin: 30px; + background-color: white; + font-size: 7vh; + /* height: 10vh; */ + text-align: center; + justify-content: center; +} + +#fight { + height: 15vh; + width: 20vh; + background-color: red; + margin: 10px auto; + border-radius: 24px; +} + +#fight img { + height: 15vh; + width: 20vh; +} + + +/* selected options section */ + +#army { + height: 15vh; + margin: 10px auto; + width: 90%; + display: flex; + align-items: center; + justify-content: center; +} + +#army p { + text-decoration: black; + text-align: center; + font-size: 2vh; + padding: 10px; +} + +.coin { + background-color: white; + border-radius: 28px; + width: 16vh; + height: 10vh; + margin: auto; +} + + +#system,#user { + + + height: 10vh; + +#system { + height: 8vh; + + width: 15vh; + margin: auto; + border-radius: 23px; + border: 8px solid gold; +} + height: 8vh; + width: 15vh; + margin: auto; + border-radius: 18px; + border: 4px solid gold; +} + +#user { + border-radius: 23px; + border: 8px solid gold; + height: 8vh; + margin: auto; + width: 15vh; +} + +#state { + margin: auto; + font-size: 1rem; +} + +#home { + display: flex; + background-color: yellow; + border: 10px solid yellowgreen; + padding: 5px; + justify-content: center; + align-items: center; +} + +#question { + border: 10px solid yellowgreen; + border-bottom: none; + background-color: white; + font-size: 3em; + height: max-content; + color: red; + padding: 4px; + overflow: auto; + /* margin: 0; */ + text-align: center; +} + + +/* user planel */ +#user img,#system img { + height: 7vh; + width: 14vh; + margin: auto; + border-radius: 18px; + +} + +.weapon { + border: 10px solid white; + border-radius: 25px; + background-color: white; + font-size: 2.5vh; + margin: 20px; + height: 12vh; + width: 20vh; + text-align: center; +} +.weapon img{ + height: 7vh; + width: 14; +} + +#info { + height: 80vh; + justify-content: flex-start; + padding: 12px; + margin: 5vh auto; +} + +#info h1 { + font-size: 6em; + margin: 1vh; + font-family: 'Courier New', Courier, monospace; +} + +#info p { + text-indent: 100px; + font-size: 3vh; + margin: 1vh 3vh; + text-align: justify; + font-family: cursive; +} + +#devinfo { + border: 1px solid black; + border-radius: 23px; + height: max-content; + margin: 5vh 1vh 2vh 1vh; +} + +#devinfo p { + text-align: center; + font-size: 2vh; + margin: 1vh; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +#devinfo img { + height: 4vh; + width: 4vh; + border-radius: 8px; + padding: 2px; +} + +#devinfo a { + font-family: cursive; +} + +#devinfo span { + padding: 1vh; + margin-bottom: 1vh; +} + +@media(min-width:1024px) { + #abs { + left: 50%; + margin-left: -50vh; + } +} \ No newline at end of file diff --git a/Snake Water Gun/static/images/cong1.jpg b/Snake Water Gun/static/images/cong1.jpg new file mode 100644 index 00000000..273a3cd9 Binary files /dev/null and b/Snake Water Gun/static/images/cong1.jpg differ diff --git a/Snake Water Gun/static/images/copy.png b/Snake Water Gun/static/images/copy.png new file mode 100644 index 00000000..ec13b3b1 Binary files /dev/null and b/Snake Water Gun/static/images/copy.png differ diff --git a/Snake Water Gun/static/images/draw.jpg b/Snake Water Gun/static/images/draw.jpg new file mode 100644 index 00000000..98d50765 Binary files /dev/null and b/Snake Water Gun/static/images/draw.jpg differ diff --git a/Snake Water Gun/static/images/email.png b/Snake Water Gun/static/images/email.png new file mode 100644 index 00000000..0dd9abfd Binary files /dev/null and b/Snake Water Gun/static/images/email.png differ diff --git a/Snake Water Gun/static/images/facebook.png b/Snake Water Gun/static/images/facebook.png new file mode 100644 index 00000000..ca03e016 Binary files /dev/null and b/Snake Water Gun/static/images/facebook.png differ diff --git a/Snake Water Gun/static/images/gun.jpg b/Snake Water Gun/static/images/gun.jpg new file mode 100644 index 00000000..71e125cb Binary files /dev/null and b/Snake Water Gun/static/images/gun.jpg differ diff --git a/Snake Water Gun/static/images/instagram.jpg b/Snake Water Gun/static/images/instagram.jpg new file mode 100644 index 00000000..a8f0093f Binary files /dev/null and b/Snake Water Gun/static/images/instagram.jpg differ diff --git a/Snake Water Gun/static/images/linkedin.jpg b/Snake Water Gun/static/images/linkedin.jpg new file mode 100644 index 00000000..e77e61f6 Binary files /dev/null and b/Snake Water Gun/static/images/linkedin.jpg differ diff --git a/Snake Water Gun/static/images/snake.jpg b/Snake Water Gun/static/images/snake.jpg new file mode 100644 index 00000000..60b39c7a Binary files /dev/null and b/Snake Water Gun/static/images/snake.jpg differ diff --git a/Snake Water Gun/static/images/water.jpg b/Snake Water Gun/static/images/water.jpg new file mode 100644 index 00000000..0ec12375 Binary files /dev/null and b/Snake Water Gun/static/images/water.jpg differ diff --git a/Snake Water Gun/static/images/whatsapp.jpg b/Snake Water Gun/static/images/whatsapp.jpg new file mode 100644 index 00000000..1657cef0 Binary files /dev/null and b/Snake Water Gun/static/images/whatsapp.jpg differ diff --git a/Snake Water Gun/static/js/swg.js b/Snake Water Gun/static/js/swg.js new file mode 100644 index 00000000..543866a3 --- /dev/null +++ b/Snake Water Gun/static/js/swg.js @@ -0,0 +1,245 @@ +let uname = "User" +let upt = 0 +let opt = 0 +var no = 10 +let totalNo = 0 + +function copyFunc() { + var copyText = document.getElementById("copyurl"); + copyText.focus() + copyText.select() + copyText.setSelectionRange(0, 99999) + document.execCommand("copy"); + alert("Copied the url: " + copyText.value); +} +// function copyFunc() { +// window.prompt("Copy to clipboard:", 'https: //vigneshnu.herokuapp.com/swg.html'); +// } + +function sign() { + let regex = /[a-zA-Z]{3,15}/; + let reg = /[5-50]/; + namesign = `
+
+

Snake Water Gun

+
+ Your Name : + + How many Rounds
do you want to play?
+ +
+ +
` + + document.getElementById("entry").innerHTML = namesign + + play = document.getElementById("play").addEventListener("click", () => { + uname = document.getElementById("name").value + no = parseInt(document.getElementById("noOfRounds").value) + totalNo = no + if (regex.test(uname) && reg.test(no)) { + entry = document.getElementById("entry").innerHTML = "" + document.getElementById('userName').innerText = uname + document.getElementById("rounds").innerText = `${ (totalNo + 1) - no}/${totalNo}` + + } else { + alert("Please enter your name, name shold only be alphabets and between 2-15 characters and rounds must not be null.") + } + + }) + +} + +function end(resmessage, desc) { + let link = "https://vigneshnu.herokuapp.com/swg.html" + let text = `Hey!, let's play Snake Water Gun game, have fun, let's know how lucky you are! ` + endhtml = `
+ +
+ ${resmessage} + ${uname} +

${desc}

+ +
+ + + + Replay +
+ Share on + + + + + + +
+
` + let game = document.getElementById("game").innerHTML + document.getElementById('game').innerHTML = "" + document.getElementById('end').innerHTML = endhtml + document.getElementById('replay').addEventListener("click", () => { + window.location.reload() + }) +} + + +function start(value, callback) { + no = no - 1 + sysno = Math.ceil(0 + (6 - 3) * Math.random()); + system = document.getElementById('system') + user = document.getElementById('user') + fight = document.getElementById('fight') + system.innerHTML = "" + user.innerHTML = "" + fight.innerHTML = "" + document.getElementById("msg").innerHTML = "" + document.getElementById("result").innerHTML = "" + if (value == 1) { + user.innerHTML = `snake` + } else if (value == 2) { + user.innerHTML = `water` + + } else if (value == 3) { + user.innerHTML = `gun` + + } + + if (sysno == 1) { + system.innerHTML = `snake` + } else if (sysno == 2) { + system.innerHTML = `water` + + } else if (sysno == 3) { + system.innerHTML = `gun` + + } + userno = value + rounds = document.getElementById('rounds') + userScore = document.getElementById('userScore') + systemScore = document.getElementById('systemScore') + + if (userno == "1" && sysno == "2") { + console.log(`you sysno : ${userno} && system's sysno : ${sysno} `) + console.log('You Win !') + upt += 1 + setTimeout(() => { + fight.innerHTML = `snake` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + message = `Snake drank the water` + result = `You Win !` + } else if (userno == "1" && sysno == "3") { + opt += 1 + setTimeout(() => { + fight.innerHTML = `gun` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + message = `Gun shooted the Snake` + result = `You Lost !` + } else if (userno == "3" && sysno == "2") { + opt += 1 + setTimeout(() => { + fight.innerHTML = `water` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + message = `gun lost in water` + result = `You Lost !` + } else if (userno == "3" && sysno == "1") { + upt += 1 + setTimeout(() => { + fight.innerHTML = `gun` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + message = `Gun kills the snake` + result = `You Win !` + } else if (userno == "2" && sysno == "3") { + upt += 1 + setTimeout(() => { + fight.innerHTML = `water` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + message = `gun lost in water` + result = `You Win !` + } else if (userno == "2" && sysno == "1") { + opt += 1 + setTimeout(() => { + fight.innerHTML = `snake` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + message = `Snake drank the water` + result = `You Lost !` + } else if (userno == sysno) { + upt += 1; + opt += 1; + setTimeout(() => { + fight.innerHTML = `draw` + rounds.innerText = `${ (totalNo + 1) - no}/${totalNo}` + userScore.innerText = `${upt}` + systemScore.innerText = `${opt}` + }, 300); + result = `Match draw` + message = `Both gets one point` + + } + setTimeout(() => { + msg = document.getElementById('msg').innerHTML = `

${message}

` + + }, 500); + setTimeout(() => { + + result = document.getElementById('result').innerHTML = `

${result}

` + }, 800); + + if (no == 1) { + document.getElementById('question').innerText = "" + document.getElementById("home").innerHTML = `
+ Game Over +
` + let resmessage = "" + let desc = "" + if (opt < upt) { + resmessage = "Congratulations" + desc = `You won with ${upt-opt} points` + + } else if (upt < opt) { + resmessage = "Better luck next time" + desc = `You lose with ${opt-upt} points` + + } else { + resmessage = "Match draw" + desc = `both gets ${opt} points` + + } + setTimeout(() => { + + end(resmessage, desc, start(1)) + }, 3000); + } +} + +water = document.getElementById('2').addEventListener('click', () => { + start(2) +}) +gun = document.getElementById('3').addEventListener('click', () => { + start(3) +}) +snake = document.getElementById('1').addEventListener('click', () => { + start(1) +}) \ No newline at end of file