Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Mario Matching Game #4567

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Games/Mario Matching Game/01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Mario Matching Game/02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Mario Matching Game/03.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Games/Mario Matching Game/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Mario Matching Game

Welcome to the Mario Matching Game! This game challenges players to match three identical images within a specified time limit.

## Image

![image](https://github.com/dpvasani/Mario-Matching-Game/assets/109815626/fde14fbe-05fc-4231-9d26-ec8e975a633d)


## Gameplay

- The game board consists of multiple tiles, each containing an image.

## Features

- Reset Button: Start a new game round by resetting the board and timer.

## Technologies Used

- HTML
- CSS
- JavaScript

34 changes: 34 additions & 0 deletions Games/Mario Matching Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet" />
<link href="https://fonts.cdnfonts.com/css/new-super-mario-font-u" rel="stylesheet">
<style>
@import url('https://fonts.cdnfonts.com/css/new-super-mario-font-u');
</style>
<title>Game</title>
</head>
<body>
<h2>Mario <span style="color: rgb(255, 102, 102);">Matching</span> Game</h2>
<div class = "box">
<label>
<input type="checkbox" class = "checkbox" id = "chk1">
<i></i>
</label>
<label>
<input type="checkbox" class = "checkbox" id = "chk2">
<i></i>
</label>
<label>
<input type="checkbox" class = "checkbox" id = "chk3">
<i></i>
</label>
</div>
<button type="checkbox" class="reset">Reset Game</button>
<script src="/script.js"></script>
</body>
</html>
30 changes: 30 additions & 0 deletions Games/Mario Matching Game/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
let chk1 = document.querySelector('#chk1');
let chk2 = document.querySelector('#chk2');
let chk3 = document.querySelector('#chk3');
let reset = document.querySelector('.reset');
chk1.onclick = function(){
if(chk1.checked === true){
chk1.disabled = 'true'
}
}
chk2.onclick = function(){
if(chk2.checked === true){
chk2.disabled = 'true'
}
}
chk3.onclick = function(){
if(chk3.checked === true){
chk3.disabled = 'true'
}
}

reset.onclick = function(){
chk1.disabled = false
chk1.checked = false

chk2.disabled = false
chk2.checked = false

chk3.disabled = false
chk3.checked = false
}
119 changes: 119 additions & 0 deletions Games/Mario Matching Game/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
@font-face {
font-family: 'New Super Mario Font U', sans-serif;
src: url(https://fonts.cdnfonts.com/css/new-super-mario-font-u);
}

* {
margin: 0;
padding: 0;
font-family: 'New Super Mario Font U', sans-serif;
box-sizing: border-box;
}

body
{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 100vh;

}
h2
{
padding: 1rem;
text-align: center ;
margin-bottom: 3rem;
font-size: 2.5em;
}
.box
{
position: relative;
width: 600px;
height: 200px;
border: 1px solid #888888;
box-shadow: 5px 10px #888888;
display: flex;
flex-wrap: wrap;
flex-direction: column;
align-items: center;
justify-content: center;
}
.box label
{
position: relative;
width: 100%;
height: 33.333%;
border: 1px solid black;
border-bottom: none;
}

.box label input {
position: relative;
appearance: none;
z-index: 10;
}

.box label i{
position:absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: 600px;
}

.box label:nth-child(1) i {
background-image: url(01.jpg);
animation: animate 0.5s steps(3) infinite;
}
.box label:nth-child(2) i {
background-image: url(02.jpg);
animation: animate 0.4s steps(3) infinite;
}
.box label:nth-child(3) i {
background-image: url(03.jpg);
animation: animate 0.7s steps(3) infinite;
}

@keyframes animate{
0%
{
background-position: 0px;
}
100%
{
background-position: 600px;
}
}

.box label input:checked ~ i {
animation-play-state: paused;
}

.reset{
margin-top: 3rem;
padding: 1rem;
font-size: large;
letter-spacing: 5px;
background-color: rgba(44, 40, 40, 0.897);
color: rgb(255, 255, 255);
border: none;
font-weight: 700;
}

.reset:active
{
background: rgba(250, 112, 102, 0.89);
transform: scale(0.95);
}

@media screen and (max-width:600px) {
.box {
width: 300px;
height: 100px;
}
.box label i{
background-size: 300px;
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ This repository also provides one such platforms where contributers come over an
| [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)|
|[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)|
|[Wheel_of_fortune](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Wheel_of_fortune)|
|[Dot_Box_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Dot_Box_Game)|
Expand Down
Binary file added assets/images/Mario Matching Game (1).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Mario Matching Game (2).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Mario Matching Game (3).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading