diff --git a/README.md b/README.md index 2d4efa8d..430b6fc2 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,7 @@ ________________________________________________________________________________ | 188 | [Cubula_Game](.SinglePlayer%20-%20Games/Cubula_Game) | | 189 | [Ball_Shooting_Game](.SinglePlayer%20-%20Games/Ball_Shooting_Game) | | 190 | [Baseball_Game](.SinglePlayer%20-%20Games/Baseball_Game) | +| 190 | [Ball_Fall_Game](.SinglePlayer%20-%20Games/Ball_Fall_Game) | diff --git a/SinglePlayer - Games/Ball_Fall_Game/Chopsic.ttf b/SinglePlayer - Games/Ball_Fall_Game/Chopsic.ttf new file mode 100644 index 00000000..dec2e881 Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/Chopsic.ttf differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/README.md b/SinglePlayer - Games/Ball_Fall_Game/README.md new file mode 100644 index 00000000..d01d6653 --- /dev/null +++ b/SinglePlayer - Games/Ball_Fall_Game/README.md @@ -0,0 +1,7 @@ +# Ball_Fall_Game + +"The ball is lost in the extremeties of space while exploring.If its touches the extreme of space,it will lose it life.Manage to save the ball's life by drawing it towards the bottom and extending its life time....Lets Start!! " + +# How to play + +Use keyboard keys or on screen keys diff --git a/SinglePlayer - Games/Ball_Fall_Game/bg.gif b/SinglePlayer - Games/Ball_Fall_Game/bg.gif new file mode 100644 index 00000000..a6c36c72 Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/bg.gif differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/bricktouch.wav b/SinglePlayer - Games/Ball_Fall_Game/bricktouch.wav new file mode 100644 index 00000000..b89a38b3 Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/bricktouch.wav differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/favicon-32x32.png b/SinglePlayer - Games/Ball_Fall_Game/favicon-32x32.png new file mode 100644 index 00000000..7df7f2da Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/favicon-32x32.png differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/fonts/Chopsic.ttf b/SinglePlayer - Games/Ball_Fall_Game/fonts/Chopsic.ttf new file mode 100644 index 00000000..dec2e881 Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/fonts/Chopsic.ttf differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/front.html b/SinglePlayer - Games/Ball_Fall_Game/front.html new file mode 100644 index 00000000..797ddae7 --- /dev/null +++ b/SinglePlayer - Games/Ball_Fall_Game/front.html @@ -0,0 +1,48 @@ + + + + + + + Ball Fall + + + + +
+
+ + + +
+
+
+ + +
+
+
+ + + diff --git a/SinglePlayer - Games/Ball_Fall_Game/gameover.wav b/SinglePlayer - Games/Ball_Fall_Game/gameover.wav new file mode 100644 index 00000000..57c8275a Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/gameover.wav differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/index.css b/SinglePlayer - Games/Ball_Fall_Game/index.css new file mode 100644 index 00000000..2e893cc3 --- /dev/null +++ b/SinglePlayer - Games/Ball_Fall_Game/index.css @@ -0,0 +1,245 @@ +@font-face { + font-family: "chopsic"; + src: url("Chopsic.ttf"); +} + +body { + margin: 0; + padding: 0; + background-image: url("bg.gif"); + overflow-y: hidden; + overflow-x: hidden; +} + +.btn img{ + border: 3px solid whitesmoke; +} +@media screen and (width:280px){ + #canvas{ + height: 250px; + width:250px; + } + + .group { + display: flex; + flex-direction: column; + justify-content: center; + } + + .main-container { + font-family: chopsic, serif; + font-size: 4vh; + justify-content: center; + align-items: center; + color: antiquewhite; + width: 100vw; + height: 75vh; + border: black 1px solid; + display: flex; + } + + .btn-container { + display: inline-block; + justify-content: center; + } + + .btnbox { + display: flex; + width: 100vw; + justify-content: center; + } + + .btn { + background-color: transparent; + padding: 15px; + justify-content: center; + align-items: center; + + } +} + +@media screen and (min-width:281px) and (max-width:500px) { + #canvas { + height: 300px; + width: 300px; + } + + .group { + display: flex; + flex-direction: column; + justify-content: center; + } + + .main-container { + font-family: chopsic, serif; + font-size: 4vh; + justify-content: center; + align-items: center; + color: antiquewhite; + width: 100vw; + height: 75vh; + border: black 1px solid; + display: flex; + } + + .btn-container { + display: inline-block; + justify-content: center; + } + + .btnbox { + display: flex; + width: 30vw; + padding-left: 140px; + justify-content: center; + } + + .btn { + background-color: transparent; + padding: 15px; + justify-content: center; + align-items: center; + + } + +} + +@media screen and (min-width:501px) and (max-width:850px) { + #canvas { + height: 500px; + width: 500px; + } + + .group { + display: flex; + flex-direction: column; + justify-content: center; + } + + .main-container { + font-family: chopsic, serif; + font-size: 4vh; + justify-content: center; + align-items: center; + color: antiquewhite; + width: 100vw; + height: 75vh; + border: black 1px solid; + display: flex; + } + + .btn-container { + display: inline-block; + justify-content: center; + } + + .btnbox { + display: flex; + width: 60vw; + padding-left: 140px; + justify-content: center; + } + + .btn { + background-color: transparent; + padding: 15px; + justify-content: center; + align-items: center; + + } + +} + +@media screen and (min-width:851px) and (max-height:850px) { + #canvas { + height:600px; + width: 600px; + } + + .group { + display: flex; + flex-direction: row; + justify-content: center; + padding: 0px; + } + + .main-container { + font-family: chopsic, serif; + font-size: 4vh; + justify-content: center; + align-items: center; + color: antiquewhite; + width: 50vw; + height: 90vh; + padding: 80px; + border: black 1px solid; + display: flex; + } + + .btn-container { + display: flex; + justify-content: center; + align-items: center; + height:90vh; + } + + .btnbox { + display: flex; + justify-content: center; + } + + .btn { + background-color: transparent; + padding: 15px; + justify-content: center; + align-items: center; + + } + +} + +@media screen and (min-width:851px) and (min-height:851px) { + #canvas { + height: 600px; + width: 600px; + } + + .group { + display: flex; + flex-direction: column; + justify-content: center; + } + + .main-container { + font-family: chopsic, serif; + font-size: 4vh; + justify-content: center; + align-items: center; + color: antiquewhite; + width: 100vw; + height: 75vh; + border: black 1px solid; + display: flex; + } + + .btn-container { + display: inline-block; + justify-content: center; + } + + .btnbox { + display: flex; + width: 60vw; + padding-left: 140px; + justify-content: center; + } + + .btn { + background-color: transparent; + padding: 15px; + justify-content: center; + align-items: center; + + } + +} \ No newline at end of file diff --git a/SinglePlayer - Games/Ball_Fall_Game/index.html b/SinglePlayer - Games/Ball_Fall_Game/index.html new file mode 100644 index 00000000..0fb78acc --- /dev/null +++ b/SinglePlayer - Games/Ball_Fall_Game/index.html @@ -0,0 +1,114 @@ + + + + + + + Ball Fall + + + + + + +
+
+

The Ball Fall

+

+

Play Game

+
+ + + diff --git a/SinglePlayer - Games/Ball_Fall_Game/index.js b/SinglePlayer - Games/Ball_Fall_Game/index.js new file mode 100644 index 00000000..0f347e86 --- /dev/null +++ b/SinglePlayer - Games/Ball_Fall_Game/index.js @@ -0,0 +1,215 @@ + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext("2d"); + const cwidth = canvas.width; + const cheight = canvas.height; + const leftBtn = document.getElementById("left"); + const rightBtn = document.getElementById("right"); + + + function randHoleX() { + return Math.floor(Math.random() * 270); + } + + let ball = { x: 300, y: 0, r: 9 }; + let Platforms = [ + { x: 0, y: cheight, w: cwidth, h: 12, holeX: randHoleX(), holeW: 40 }, + ]; + let leftpressed = false; + let rightpressed = false; + let interval = (scoreInterval = null); + let score = 0; + let gravity = 0.5; +let dropSpeed = 0; +let a = 0; +var over; +var settle; + +settle = new Audio("bricktouch.wav"); +over = new Audio("gameover.wav"); + + scoreInterval = setInterval(() => { + score++; + }, 1000); + + drawBall(); + drawPlatforms(); + movePlatforms(); + +var timer=setInterval(score,1000) + + function movePlatforms() { + let count = 0; + setInterval(() => { + if (count == Math.floor(50)) { + if (Platforms.length > 10) { + Platforms.splice(0,2); + } + Platforms.push({ + x: 0, + y: cheight + 40, + w: cwidth, + h: 12, + holeX: randHoleX(), + holeW: 40, + }); + count = 0; + } + Platforms.forEach((pl) => { + pl.y = pl.y - 1.5; + }); + + const closest = Platforms.find( + (pl) => ball.y < pl.y + 10 && ball.y > pl.y - ball.r + ); + + if (closest) { + holdAndDrop(closest); + } else { + dropSpeed += gravity; + ball.y += 5; + } + + ctx.clearRect(0, 0, cwidth, cheight); + drawPlatforms(); + drawBall(); + checkGameOver(); + drawScore(); + if (score > 15) { + Platforms.forEach((pl) => { + pl.y = pl.y - .4; + }) + ball.y += 5; + + } + else if(score>40){ + Platforms.forEach((pl) => { + pl.y = pl.y - .5; + }) + } + count++; + }, 20); + } + +function checkGameOver() { + if (ball.y < 0 && a==0) { + gameover(); + } + } + +function gameover() { + a = 1; + over.play(); + if (!(alert("Game Over!! \nBetter Luck Next Time\n Score:" + score))) { + window.location.reload(); + } + clearInterval(timer) + interval = null + +} + + + function holdAndDrop(closest) { + if (ball.y > closest.y - ball.r) { + if ( + ball.x > closest.holeX && + ball.x < closest.holeX + closest.holeW + ) { + settle.play(); + ball.y += 1; + } else { + ball.y = closest.y - ball.r; + } + } + } + +function drawBall() { + moveleft(); + moveright(); + ctx.beginPath(); + ctx.arc(ball.x, ball.y, ball.r, 0, 2 * Math.PI); + ctx.fillStyle = "brown"; + ctx.stroke = "2px solid black"; + ctx.fill(); + ctx.closePath(); +} + function moveleft(){ + if (ball.x - ball.r > 0) { + ball.x -= 5; +} +}; + +function moveright() { + if (ball.x + ball.r < cwidth) { + ball.x += 5; + } +} + + function moveleftbtn(){ + if (ball.x - ball.r > 0) { + ball.x -= 10; +} +}; + +function moverightbtn() { + if (ball.x + ball.r < cwidth) { + ball.x += 10; + } +} + function drawScore() { + ctx.beginPath(); + ctx.fillStyle = "white"; + ctx.fill(); + ctx.font = "30px chopsic"; + ctx.fillText("Score:" + score, 20, 30); + ctx.closePath(); +} + +function levelDisplay() { + ctx.beginPath(); + ctx.fillStyle = "white"; + ctx.fill(); + ctx.font = "20px chopsic"; + ctx.fillStyle = "text-align:right"; + if (score < 15) { + ctx.fillText("Level 1"); + } + + } + + function drawPlatforms() { + Platforms.forEach((pl) => { + createPl(pl); + createHole(pl); + navigationBall(); + drawScore(); + }); + + function createHole(pl) { + ctx.beginPath(); + ctx.rect(pl.holeX, pl.y, pl.holeW, pl.h); + ctx.fillStyle = "black"; + ctx.fill(); + ctx.closePath(); + } + + function createPl(pl) { + ctx.beginPath(); + ctx.rect(pl.x, pl.y, pl.w, pl.h); + ctx.fillStyle = "grey"; + ctx.fill(); + ctx.closePath(); + } + } + function navigationBall() { + document.onkeydown = function (e) { + switch (e.keyCode) { + case 37: + moveleft(); + break; + case 39: + moveright(); + break; + } + }; + +} diff --git a/SinglePlayer - Games/Ball_Fall_Game/left.png b/SinglePlayer - Games/Ball_Fall_Game/left.png new file mode 100644 index 00000000..a4a471eb Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/left.png differ diff --git a/SinglePlayer - Games/Ball_Fall_Game/right.png b/SinglePlayer - Games/Ball_Fall_Game/right.png new file mode 100644 index 00000000..3cca1b92 Binary files /dev/null and b/SinglePlayer - Games/Ball_Fall_Game/right.png differ diff --git a/SinglePlayer - Games/Banner - image/Ball_Fall_Game.png b/SinglePlayer - Games/Banner - image/Ball_Fall_Game.png new file mode 100644 index 00000000..277352b2 Binary files /dev/null and b/SinglePlayer - Games/Banner - image/Ball_Fall_Game.png differ diff --git a/additionalpage/game.html b/additionalpage/game.html index 76d3ce59..879d7d22 100644 --- a/additionalpage/game.html +++ b/additionalpage/game.html @@ -7180,6 +7180,62 @@

Baseball_Game

+ +
+
+ + +
+ 45 + +
+
+
+ + +
+
+

Ball_Fall_Game

+

Ball_Fall_Game

+
+
+ + + + + +
+
+
+
+
+

Release Date:  

+

20.06.2023

+
+
+

Updated:  

+

Action | Desktop

+
+
+
+ Play Now +
+
+
+
+ + + + +