๐จ NEW GAME DROPPING SOON! ๐ฎ
Can you beat this game? ๐
Can you beat this game? ๐
<!DOCTYPE html>
<html>
<head>
<title>Number Guessing Game</title>
<style>
body{
margin:0;
font-family:Arial;
background:#08111f;
color:white;
display:flex;
justify-content:center;
align-items:center;
height:100vh;
}
.box{
width:320px;
padding:30px;
text-align:center;
border-radius:20px;
background:#101d32;
box-shadow:0 0 30px #00eaff55;
}
h1{color:#00eaff;}
input{
width:90%;
padding:12px;
border-radius:10px;
border:0;
margin:10px;
font-size:18px;
}
button{
padding:12px 25px;
border:0;
border-radius:20px;
background:#00eaff;
font-weight:bold;
cursor:pointer;
}
#msg{
margin-top:20px;
font-size:18px;
}
</style>
</head>
<body>
<div class="box">
<h1>๐ฏ Guess The Number</h1>
<p>Guess a number between 1 and 100</p>
<input id="guess" type="number" placeholder="Enter number">
<button onclick="check()">GUESS</button>
<p id="msg"></p>
<p>Attempts: <span id="attempts">0</span></p>
</div>
<script>
let number=Math.floor(Math.random()*100)+1;
let attempts=0;
function check(){
let guess=Number(document.getElementById("guess").value);
if(!guess){
document.getElementById("msg").textContent="โ ๏ธ Enter a number!";
return;
}
attempts++;
document.getElementById("attempts").textContent=attempts;
if(guess===number){
document.getElementById("msg").textContent=
"๐ Correct! You won!";
}else if(guess<number){
document.getElementById("msg").textContent=
"โฌ๏ธ Try a higher number";
}else{
document.getElementById("msg").textContent=
"โฌ๏ธ Try a lower number";
}
}
</script>
</body>
</html>
<html>
<head>
<title>Number Guessing Game</title>
<style>
body{
margin:0;
font-family:Arial;
background:#08111f;
color:white;
display:flex;
justify-content:center;
align-items:center;
height:100vh;
}
.box{
width:320px;
padding:30px;
text-align:center;
border-radius:20px;
background:#101d32;
box-shadow:0 0 30px #00eaff55;
}
h1{color:#00eaff;}
input{
width:90%;
padding:12px;
border-radius:10px;
border:0;
margin:10px;
font-size:18px;
}
button{
padding:12px 25px;
border:0;
border-radius:20px;
background:#00eaff;
font-weight:bold;
cursor:pointer;
}
#msg{
margin-top:20px;
font-size:18px;
}
</style>
</head>
<body>
<div class="box">
<h1>๐ฏ Guess The Number</h1>
<p>Guess a number between 1 and 100</p>
<input id="guess" type="number" placeholder="Enter number">
<button onclick="check()">GUESS</button>
<p id="msg"></p>
<p>Attempts: <span id="attempts">0</span></p>
</div>
<script>
let number=Math.floor(Math.random()*100)+1;
let attempts=0;
function check(){
let guess=Number(document.getElementById("guess").value);
if(!guess){
document.getElementById("msg").textContent="โ ๏ธ Enter a number!";
return;
}
attempts++;
document.getElementById("attempts").textContent=attempts;
if(guess===number){
document.getElementById("msg").textContent=
"๐ Correct! You won!";
}else if(guess<number){
document.getElementById("msg").textContent=
"โฌ๏ธ Try a higher number";
}else{
document.getElementById("msg").textContent=
"โฌ๏ธ Try a lower number";
}
}
</script>
</body>
</html>
โค๏ธ Like | ๐ Share | ๐ข Forward
๐ฅ Next game tomorrow!
๐ฅ Next game tomorrow!
๐ CODE2GAME HTML RUNNER IS LIVE! ๐ฎ
๐ป Apna HTML/CSS/JS code paste karo
โถ๏ธ RUN CODE dabao
๐น๏ธ Aur apna game instantly test karo!
๐ฅ Try it now:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
CODE โข RUN โข PLAY โข CREATE โก
๐ป Apna HTML/CSS/JS code paste karo
โถ๏ธ RUN CODE dabao
๐น๏ธ Aur apna game instantly test karo!
๐ฅ Try it now:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
CODE โข RUN โข PLAY โข CREATE โก
๐ฅ1
๐ชจ๐โ๏ธ DAY 2 โ ROCK PAPER SCISSORS! ๐ฅ
Ready for today's challenge? ๐ฎ
๐ค Computer ke against khelo!
๐ Dekho kaun zyada rounds jeetta hai!
๐ป HTML + CSS + JavaScript
๐ฑ Mobile Friendly
โก Easy to Run
๐ FULL SOURCE CODE NEXT POST MEIN
๐ฅ Try it โข Play it โข Share it
CodeForge Gaming Community ๐
#Day2 #RockPaperScissors #HTML #JavaScript #GameCoding
Ready for today's challenge? ๐ฎ
๐ค Computer ke against khelo!
๐ Dekho kaun zyada rounds jeetta hai!
๐ป HTML + CSS + JavaScript
๐ฑ Mobile Friendly
โก Easy to Run
๐ FULL SOURCE CODE NEXT POST MEIN
๐ฅ Try it โข Play it โข Share it
CodeForge Gaming Community ๐
#Day2 #RockPaperScissors #HTML #JavaScript #GameCoding
๐1๐ฅ1
<!DOCTYPE html>
<html>
<head>
<title>Rock Paper Scissors</title>
<style>
body{
margin:0;
height:100vh;
display:flex;
justify-content:center;
align-items:center;
background:#090909;
color:white;
font-family:Arial;
}
.game{
text-align:center;
padding:30px;
width:350px;
border-radius:25px;
background:#151515;
box-shadow:0 0 30px #ff007755;
}
h1{
color:#ff2d8d;
}
button{
font-size:35px;
margin:8px;
padding:15px;
border:0;
border-radius:15px;
cursor:pointer;
background:#222;
}
button:hover{
transform:scale(1.1);
}
#result{
margin-top:25px;
font-size:20px;
}
.score{
font-size:18px;
}
</style>
</head>
<body>
<div class="game">
<h1>๐ชจ Rock Paper Scissors</h1>
<p>Choose your move</p>
<button onclick="play('Rock')">๐ชจ</button>
<button onclick="play('Paper')">๐</button>
<button onclick="play('Scissors')">โ๏ธ</button>
<div id="result"></div>
<p class="score">
You: <span id="you">0</span>
AI: <span id="ai">0</span>
</p>
</div>
<script>
let you=0;
let ai=0;
function play(player){
const choices=["Rock","Paper","Scissors"];
const computer=
choices[Math.floor(Math.random()*3)];
let result="";
if(player===computer){
result="๐ค Draw!";
}else if(
(player==="Rock" && computer==="Scissors") ||
(player==="Paper" && computer==="Rock") ||
(player==="Scissors" && computer==="Paper")
){
you++;
result="๐ You Win!";
}else{
ai++;
result="๐ค AI Wins!";
}
document.getElementById("result").innerHTML=
result+"<br>You: "+player+
"<br>AI: "+computer;
document.getElementById("you").textContent=you;
document.getElementById("ai").textContent=ai;
}
</script>
</body>
</html>
<html>
<head>
<title>Rock Paper Scissors</title>
<style>
body{
margin:0;
height:100vh;
display:flex;
justify-content:center;
align-items:center;
background:#090909;
color:white;
font-family:Arial;
}
.game{
text-align:center;
padding:30px;
width:350px;
border-radius:25px;
background:#151515;
box-shadow:0 0 30px #ff007755;
}
h1{
color:#ff2d8d;
}
button{
font-size:35px;
margin:8px;
padding:15px;
border:0;
border-radius:15px;
cursor:pointer;
background:#222;
}
button:hover{
transform:scale(1.1);
}
#result{
margin-top:25px;
font-size:20px;
}
.score{
font-size:18px;
}
</style>
</head>
<body>
<div class="game">
<h1>๐ชจ Rock Paper Scissors</h1>
<p>Choose your move</p>
<button onclick="play('Rock')">๐ชจ</button>
<button onclick="play('Paper')">๐</button>
<button onclick="play('Scissors')">โ๏ธ</button>
<div id="result"></div>
<p class="score">
You: <span id="you">0</span>
AI: <span id="ai">0</span>
</p>
</div>
<script>
let you=0;
let ai=0;
function play(player){
const choices=["Rock","Paper","Scissors"];
const computer=
choices[Math.floor(Math.random()*3)];
let result="";
if(player===computer){
result="๐ค Draw!";
}else if(
(player==="Rock" && computer==="Scissors") ||
(player==="Paper" && computer==="Rock") ||
(player==="Scissors" && computer==="Paper")
){
you++;
result="๐ You Win!";
}else{
ai++;
result="๐ค AI Wins!";
}
document.getElementById("result").innerHTML=
result+"<br>You: "+player+
"<br>AI: "+computer;
document.getElementById("you").textContent=you;
document.getElementById("ai").textContent=ai;
}
</script>
</body>
</html>
๐ฅ1๐ฅฐ1
๐ฎ๐ฅ DAY 2 โ ROCK PAPER SCISSORS ๐ชจ๐โ๏ธ
Code paste kar diya? Ab game ko LIVE PLAY karo! ๐
๐ค Computer ko challenge karo
๐ Apna score dekho
๐ฅ Try to beat the computer!
๐ป PLAY / RUN THE GAME:
https://anadverma956989936-lab.github.io/Code2Game-Runner/
๐ฑ How to run:
1๏ธโฃ HTML โ HTML code
2๏ธโฃ CSS โ CSS code
3๏ธโฃ JS โ JavaScript code
4๏ธโฃ Preview mein game play karo ๐ฎ
โค๏ธ Like | ๐ Share | ๐ข Forward
CodeForge Gaming Community โก
#Day2 #RockPaperScissors #HTML #CSS #JavaScript #GameCoding
Code paste kar diya? Ab game ko LIVE PLAY karo! ๐
๐ค Computer ko challenge karo
๐ Apna score dekho
๐ฅ Try to beat the computer!
๐ป PLAY / RUN THE GAME:
https://anadverma956989936-lab.github.io/Code2Game-Runner/
๐ฑ How to run:
1๏ธโฃ HTML โ HTML code
2๏ธโฃ CSS โ CSS code
3๏ธโฃ JS โ JavaScript code
4๏ธโฃ Preview mein game play karo ๐ฎ
โค๏ธ Like | ๐ Share | ๐ข Forward
CodeForge Gaming Community โก
#Day2 #RockPaperScissors #HTML #CSS #JavaScript #GameCoding
๐ฅฐ1๐1๐ฏ1
โก๐ฅ DAY 3 โ SPEED CLICK CHALLENGE! ๐ฅโก
You have only โฑ๏ธ 10 SECONDS!
๐ฑ๏ธ Click as fast as you can
๐ Beat your HIGH SCORE
๐ฑ Mobile Friendly
๐ป HTML + CSS + JavaScript
๐ฎ PLAY THE GAME:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
๐ CHALLENGE:
Can you beat 50 clicks? ๐
๐ฌ Apna score batao!
โค๏ธ Like | ๐ Share | ๐ข Forward
โก CodeForge Gaming Community
#Day3 #SpeedClick #HTML #CSS #JavaScript #GameCoding
You have only โฑ๏ธ 10 SECONDS!
๐ฑ๏ธ Click as fast as you can
๐ Beat your HIGH SCORE
๐ฑ Mobile Friendly
๐ป HTML + CSS + JavaScript
๐ฎ PLAY THE GAME:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
๐ CHALLENGE:
Can you beat 50 clicks? ๐
๐ฌ Apna score batao!
โค๏ธ Like | ๐ Share | ๐ข Forward
โก CodeForge Gaming Community
#Day3 #SpeedClick #HTML #CSS #JavaScript #GameCoding
โค1๐ฅ1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Speed Click Challenge</title>
<style>
*{
box-sizing:border-box;
}
body{
margin:0;
min-height:100vh;
display:flex;
justify-content:center;
align-items:center;
font-family:Arial,sans-serif;
background:#070b18;
color:white;
}
.game{
width:92%;
max-width:450px;
padding:30px 20px;
text-align:center;
border-radius:25px;
background:#111a30;
box-shadow:0 0 35px #00eaff55;
}
h1{
color:#00eaff;
margin-bottom:5px;
}
.subtitle{
color:#aaa;
margin-bottom:25px;
}
.stats{
display:flex;
justify-content:space-around;
margin-bottom:25px;
}
.stat{
padding:12px 18px;
border-radius:12px;
background:#192541;
}
.stat span{
display:block;
margin-top:5px;
color:#00eaff;
font-size:24px;
font-weight:bold;
}
#clickButton{
width:220px;
height:220px;
border:none;
border-radius:50%;
background:#00eaff;
color:#061018;
font-size:24px;
font-weight:bold;
cursor:pointer;
box-shadow:0 0 40px #00eaff66;
transition:0.1s;
}
#clickButton:active{
transform:scale(0.92);
}
#clickButton:disabled{
opacity:0.5;
cursor:not-allowed;
}
#startButton{
margin-top:25px;
padding:13px 28px;
border:none;
border-radius:25px;
background:#ff2d75;
color:white;
font-size:16px;
font-weight:bold;
cursor:pointer;
}
.message{
margin-top:20px;
min-height:24px;
color:#ddd;
}
</style>
</head>
<body>
<div class="game">
<h1>โก SPEED CLICK</h1>
<p class="subtitle">
Click as fast as you can in 10 seconds!
</p>
<div class="stats">
<div class="stat">
CLICKS
<span id="score">0</span>
</div>
<div class="stat">
TIME
<span id="time">10</span>
</div>
<div class="stat">
BEST
<span id="best">0</span>
</div>
</div>
<button id="clickButton" disabled>
START FIRST
</button>
<br>
<button id="startButton">
๐ START GAME
</button>
<div id="message" class="message">
Ready for the challenge?
</div>
</div>
<script>
const clickButton =
document.getElementById("clickButton");
const startButton =
document.getElementById("startButton");
const scoreDisplay =
document.getElementById("score");
const timeDisplay =
document.getElementById("time");
const bestDisplay =
document.getElementById("best");
const message =
document.getElementById("message");
let score = 0;
let time = 10;
let playing = false;
let timer = null;
let best =
Number(localStorage.getItem("speedBest")) || 0;
bestDisplay.textContent = best;
startButton.addEventListener("click", startGame);
clickButton.addEventListener("click", () => {
if(!playing) return;
score++;
scoreDisplay.textContent = score;
});
function startGame(){
clearInterval(timer);
score = 0;
time = 10;
playing = true;
scoreDisplay.textContent = score;
timeDisplay.textContent = time;
clickButton.disabled = false;
clickButton.textContent = "CLICK!";
startButton.disabled = true;
message.textContent =
"๐ฅ GO! Click as fast as possible!";
timer = setInterval(() => {
time--;
timeDisplay.textContent = time;
if(time <= 0){
endGame();
}
},1000);
}
function endGame(){
clearInterval(timer);
playing = false;
clickButton.disabled = true;
clickButton.textContent = "TIME UP!";
startButton.disabled = false;
if(score > best){
best = score;
localStorage.setItem(
"speedBest",
best
);
bestDisplay.textContent = best;
message.textContent =
"๐ NEW HIGH SCORE! " + score + " CLICKS!";
}
else{
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Speed Click Challenge</title>
<style>
*{
box-sizing:border-box;
}
body{
margin:0;
min-height:100vh;
display:flex;
justify-content:center;
align-items:center;
font-family:Arial,sans-serif;
background:#070b18;
color:white;
}
.game{
width:92%;
max-width:450px;
padding:30px 20px;
text-align:center;
border-radius:25px;
background:#111a30;
box-shadow:0 0 35px #00eaff55;
}
h1{
color:#00eaff;
margin-bottom:5px;
}
.subtitle{
color:#aaa;
margin-bottom:25px;
}
.stats{
display:flex;
justify-content:space-around;
margin-bottom:25px;
}
.stat{
padding:12px 18px;
border-radius:12px;
background:#192541;
}
.stat span{
display:block;
margin-top:5px;
color:#00eaff;
font-size:24px;
font-weight:bold;
}
#clickButton{
width:220px;
height:220px;
border:none;
border-radius:50%;
background:#00eaff;
color:#061018;
font-size:24px;
font-weight:bold;
cursor:pointer;
box-shadow:0 0 40px #00eaff66;
transition:0.1s;
}
#clickButton:active{
transform:scale(0.92);
}
#clickButton:disabled{
opacity:0.5;
cursor:not-allowed;
}
#startButton{
margin-top:25px;
padding:13px 28px;
border:none;
border-radius:25px;
background:#ff2d75;
color:white;
font-size:16px;
font-weight:bold;
cursor:pointer;
}
.message{
margin-top:20px;
min-height:24px;
color:#ddd;
}
</style>
</head>
<body>
<div class="game">
<h1>โก SPEED CLICK</h1>
<p class="subtitle">
Click as fast as you can in 10 seconds!
</p>
<div class="stats">
<div class="stat">
CLICKS
<span id="score">0</span>
</div>
<div class="stat">
TIME
<span id="time">10</span>
</div>
<div class="stat">
BEST
<span id="best">0</span>
</div>
</div>
<button id="clickButton" disabled>
START FIRST
</button>
<br>
<button id="startButton">
๐ START GAME
</button>
<div id="message" class="message">
Ready for the challenge?
</div>
</div>
<script>
const clickButton =
document.getElementById("clickButton");
const startButton =
document.getElementById("startButton");
const scoreDisplay =
document.getElementById("score");
const timeDisplay =
document.getElementById("time");
const bestDisplay =
document.getElementById("best");
const message =
document.getElementById("message");
let score = 0;
let time = 10;
let playing = false;
let timer = null;
let best =
Number(localStorage.getItem("speedBest")) || 0;
bestDisplay.textContent = best;
startButton.addEventListener("click", startGame);
clickButton.addEventListener("click", () => {
if(!playing) return;
score++;
scoreDisplay.textContent = score;
});
function startGame(){
clearInterval(timer);
score = 0;
time = 10;
playing = true;
scoreDisplay.textContent = score;
timeDisplay.textContent = time;
clickButton.disabled = false;
clickButton.textContent = "CLICK!";
startButton.disabled = true;
message.textContent =
"๐ฅ GO! Click as fast as possible!";
timer = setInterval(() => {
time--;
timeDisplay.textContent = time;
if(time <= 0){
endGame();
}
},1000);
}
function endGame(){
clearInterval(timer);
playing = false;
clickButton.disabled = true;
clickButton.textContent = "TIME UP!";
startButton.disabled = false;
if(score > best){
best = score;
localStorage.setItem(
"speedBest",
best
);
bestDisplay.textContent = best;
message.textContent =
"๐ NEW HIGH SCORE! " + score + " CLICKS!";
}
else{
โค1๐ฅ1
message.textContent =
"๐ฎ Game Over! Your score: " +
score +
" clicks.";
}
}
</script>
</body>
</html>
"๐ฎ Game Over! Your score: " +
score +
" clicks.";
}
}
</script>
</body>
</html>
๐1๐ฅ1
https://www.youtube.com/@pookiejanta_party-s4m
Follow my YouTube channel @pookiejanta_party๐โค๏ธ
Like๐, Share ๐ and Subscribe ๐
Follow my YouTube channel @pookiejanta_party๐โค๏ธ
Like๐, Share ๐ and Subscribe ๐
โค1๐ฅ1
๐ง ๐ฅ DAY 4 โ MEMORY MATCH GAME! ๐ฎ
Can you match all 8 pairs? ๐
๐ง Test Your Memory
๐ Complete it in minimum moves
๐ฑ Mobile Friendly
โก Fast & Fun
๐ฎ PLAY THE GAME:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
๐ CHALLENGE:
Can you complete it in under 20 moves? ๐
๐ฌ เค เคชเคจเคพ score เคฌเคคเคพเค!
โค๏ธ Like | ๐ Share | ๐ข Forward
โก CodeForge Gaming Community
#Day4 #MemoryGame #HTML #CSS #JavaScript #GameCoding
Can you match all 8 pairs? ๐
๐ง Test Your Memory
๐ Complete it in minimum moves
๐ฑ Mobile Friendly
โก Fast & Fun
๐ฎ PLAY THE GAME:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
๐ CHALLENGE:
Can you complete it in under 20 moves? ๐
๐ฌ เค เคชเคจเคพ score เคฌเคคเคพเค!
โค๏ธ Like | ๐ Share | ๐ข Forward
โก CodeForge Gaming Community
#Day4 #MemoryGame #HTML #CSS #JavaScript #GameCoding
๐1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Match Game</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
background: #070b18;
color: white;
}
.game {
width: 94%;
max-width: 430px;
padding: 25px;
text-align: center;
border-radius: 25px;
background: #111a30;
box-shadow: 0 0 35px #00eaff55;
}
h1 {
color: #00eaff;
margin-bottom: 5px;
}
.subtitle {
color: #aaa;
}
.stats {
display: flex;
justify-content: space-around;
margin: 20px 0;
padding: 12px;
border-radius: 12px;
background: #192541;
}
.board {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.card {
height: 75px;
border: none;
border-radius: 14px;
background: #263655;
color: transparent;
font-size: 30px;
cursor: pointer;
transition: 0.2s;
}
.card:hover {
transform: scale(1.05);
}
.card.flipped,
.card.matched {
background: #00a9c7;
color: white;
}
.card.matched {
background: #18b878;
}
.restart {
margin-top: 20px;
padding: 12px 25px;
border: none;
border-radius: 25px;
background: #00eaff;
color: #061018;
font-weight: bold;
font-size: 16px;
cursor: pointer;
}
@media (max-width: 360px) {
.card {
height: 65px;
}
}
</style>
</head>
<body>
<div class="game">
<h1>๐ง MEMORY MATCH</h1>
<p class="subtitle">
Match all 8 pairs!
</p>
<div class="stats">
<span>
Moves: <b id="moves">0</b>
</span>
<span>
Pairs: <b id="pairs">0</b>/8
</span>
</div>
<div id="board" class="board"></div>
<button class="restart" onclick="restartGame()">
๐ Restart Game
</button>
</div>
<script>
const symbols = [
"๐","๐",
"๐","๐",
"๐ฎ","๐ฎ",
"โก","โก",
"๐ฅ","๐ฅ",
"๐","๐",
"๐ฑ","๐ฑ",
"๐พ","๐พ"
];
let firstCard = null;
let secondCard = null;
let lockBoard = false;
let moves = 0;
let pairs = 0;
function shuffle(array) {
return array.sort(() => Math.random() - 0.5);
}
function createBoard() {
const board = document.getElementById("board");
board.innerHTML = "";
shuffle([...symbols]).forEach(symbol => {
const card = document.createElement("button");
card.className = "card";
card.dataset.symbol = symbol;
card.textContent = "?";
card.onclick = () => flipCard(card);
board.appendChild(card);
});
}
function flipCard(card) {
if (
lockBoard ||
card === firstCard ||
card.classList.contains("matched")
) {
return;
}
card.classList.add("flipped");
card.textContent = card.dataset.symbol;
if (!firstCard) {
firstCard = card;
return;
}
secondCard = card;
moves++;
document.getElementById("moves").textContent = moves;
checkMatch();
}
function checkMatch() {
const match =
firstCard.dataset.symbol ===
secondCard.dataset.symbol;
if (match) {
firstCard.classList.add("matched");
secondCard.classList.add("matched");
pairs++;
document.getElementById("pairs").textContent = pairs;
resetTurn();
if (pairs === 8) {
setTimeout(() => {
alert(
"๐ YOU WON!\n\n" +
"Total Moves: " + moves
);
}, 300);
}
} else {
lockBoard = true;
setTimeout(() => {
firstCard.classList.remove("flipped");
secondCard.classList.remove("flipped");
firstCard.textContent = "?";
secondCard.textContent = "?";
resetTurn();
}, 800);
}
}
function resetTurn() {
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Match Game</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
background: #070b18;
color: white;
}
.game {
width: 94%;
max-width: 430px;
padding: 25px;
text-align: center;
border-radius: 25px;
background: #111a30;
box-shadow: 0 0 35px #00eaff55;
}
h1 {
color: #00eaff;
margin-bottom: 5px;
}
.subtitle {
color: #aaa;
}
.stats {
display: flex;
justify-content: space-around;
margin: 20px 0;
padding: 12px;
border-radius: 12px;
background: #192541;
}
.board {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.card {
height: 75px;
border: none;
border-radius: 14px;
background: #263655;
color: transparent;
font-size: 30px;
cursor: pointer;
transition: 0.2s;
}
.card:hover {
transform: scale(1.05);
}
.card.flipped,
.card.matched {
background: #00a9c7;
color: white;
}
.card.matched {
background: #18b878;
}
.restart {
margin-top: 20px;
padding: 12px 25px;
border: none;
border-radius: 25px;
background: #00eaff;
color: #061018;
font-weight: bold;
font-size: 16px;
cursor: pointer;
}
@media (max-width: 360px) {
.card {
height: 65px;
}
}
</style>
</head>
<body>
<div class="game">
<h1>๐ง MEMORY MATCH</h1>
<p class="subtitle">
Match all 8 pairs!
</p>
<div class="stats">
<span>
Moves: <b id="moves">0</b>
</span>
<span>
Pairs: <b id="pairs">0</b>/8
</span>
</div>
<div id="board" class="board"></div>
<button class="restart" onclick="restartGame()">
๐ Restart Game
</button>
</div>
<script>
const symbols = [
"๐","๐",
"๐","๐",
"๐ฎ","๐ฎ",
"โก","โก",
"๐ฅ","๐ฅ",
"๐","๐",
"๐ฑ","๐ฑ",
"๐พ","๐พ"
];
let firstCard = null;
let secondCard = null;
let lockBoard = false;
let moves = 0;
let pairs = 0;
function shuffle(array) {
return array.sort(() => Math.random() - 0.5);
}
function createBoard() {
const board = document.getElementById("board");
board.innerHTML = "";
shuffle([...symbols]).forEach(symbol => {
const card = document.createElement("button");
card.className = "card";
card.dataset.symbol = symbol;
card.textContent = "?";
card.onclick = () => flipCard(card);
board.appendChild(card);
});
}
function flipCard(card) {
if (
lockBoard ||
card === firstCard ||
card.classList.contains("matched")
) {
return;
}
card.classList.add("flipped");
card.textContent = card.dataset.symbol;
if (!firstCard) {
firstCard = card;
return;
}
secondCard = card;
moves++;
document.getElementById("moves").textContent = moves;
checkMatch();
}
function checkMatch() {
const match =
firstCard.dataset.symbol ===
secondCard.dataset.symbol;
if (match) {
firstCard.classList.add("matched");
secondCard.classList.add("matched");
pairs++;
document.getElementById("pairs").textContent = pairs;
resetTurn();
if (pairs === 8) {
setTimeout(() => {
alert(
"๐ YOU WON!\n\n" +
"Total Moves: " + moves
);
}, 300);
}
} else {
lockBoard = true;
setTimeout(() => {
firstCard.classList.remove("flipped");
secondCard.classList.remove("flipped");
firstCard.textContent = "?";
secondCard.textContent = "?";
resetTurn();
}, 800);
}
}
function resetTurn() {
โค1๐1
firstCard = null;
secondCard = null;
lockBoard = false;
}
function restartGame() {
moves = 0;
pairs = 0;
document.getElementById("moves").textContent = "0";
document.getElementById("pairs").textContent = "0";
resetTurn();
createBoard();
}
createBoard();
</script>
</body>
</html>
secondCard = null;
lockBoard = false;
}
function restartGame() {
moves = 0;
pairs = 0;
document.getElementById("moves").textContent = "0";
document.getElementById("pairs").textContent = "0";
resetTurn();
createBoard();
}
createBoard();
</script>
</body>
</html>
๐๐ฅ DAY 5 โ SNAKE GAME! ๐ฎ
The classic game is back! ๐
๐ Eat the ๐
๐ Increase your score
๐ฅ Don't hit the wall or yourself!
๐ฑ Mobile Controls Available
โจ๏ธ Keyboard Controls Available
๐ป HTML + CSS + JavaScript
๐ฎ PLAY THE GAME:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
๐ CHALLENGE:
How high can you score? ๐
๐ฌ Apna highest score batao!
โค๏ธ Like | ๐ Share | ๐ข Forward
โก CodeForge Gaming Community
#Day5 #SnakeGame #HTML #CSS #JavaScript #GameCoding
The classic game is back! ๐
๐ Eat the ๐
๐ Increase your score
๐ฅ Don't hit the wall or yourself!
๐ฑ Mobile Controls Available
โจ๏ธ Keyboard Controls Available
๐ป HTML + CSS + JavaScript
๐ฎ PLAY THE GAME:
๐
[https://anadverma956989936-lab.github.io/Code2Game-Runner/]
๐ CHALLENGE:
How high can you score? ๐
๐ฌ Apna highest score batao!
โค๏ธ Like | ๐ Share | ๐ข Forward
โก CodeForge Gaming Community
#Day5 #SnakeGame #HTML #CSS #JavaScript #GameCoding
โค1