Skip to content

Commit

Permalink
Merge pull request #1015 from Damini2004/FlamesGame
Browse files Browse the repository at this point in the history
Flames Game has been created.
  • Loading branch information
Durgesh4993 authored Jun 15, 2024
2 parents b3717e4 + 6213da2 commit 09980cc
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 0 deletions.
Binary file not shown.
24 changes: 24 additions & 0 deletions MultiPlayer - Games/Flames_Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<html>
<head>
<title>Flames Game Using JavaScript</title>
</head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<body>

<div class="container">

<div class="sub-container">
<h3>FLAMES Game Using JavaScript</h3>
<input type='text' id='name1' placeholder="Enter First Name" required><br><br>
<input type='text' id='name2' placeholder="Enter Second Name" required ><br><br>

<input class="btn" type='button' value='FLAMES' onclick='flames()'>
<h3 id='output'></h3>
</div>
</div>
<script src="script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
</body>
</html>
82 changes: 82 additions & 0 deletions MultiPlayer - Games/Flames_Game/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

function replaceAt(string, index, replace) {
return string.substring(0, index) + replace + string.substring(index + 1);
}
function flames(){
var res=document.getElementById("output");
var a=document.getElementById("name1").value.toLowerCase();
var b=document.getElementById("name2").value.toLowerCase();
if(a!=""&&b!=""){
for (i=0;i<a.length;i++){
for(j=0;j<b.length;j++){
if(a[i]==b[j]){
a=replaceAt(a,i,'*');
b=replaceAt(b,j,'*');
}
}
}
var countLetters=0;
for (i=0;i<a.length;i++){
if(a[i]!='*'){
countLetters++;
}
}
for (i=0;i<b.length;i++){
if(b[i]!='*'){
countLetters++;
}
}
if(countLetters>1){
var flames="FLAMES";
c=0;
l=1;
for(i=0;flames.length!=1;i++){
if(l==countLetters)
{
if(c>=flames.length)
{
c=0;
}
flames=replaceAt(flames,c,'');
l=1;
}
if(c>=flames.length)
{
c=0;
}
l++;
c++;
}

switch(flames){
case 'F':
flames="Friend";
break;
case 'L':
flames="Love";
break;
case 'A':
flames="Affection";
break;
case 'M':
flames="Marriage";
break;
case 'E':
flames="Enemies";
break;
case 'S':
flames="Sibling";
break;
}
}
if(countLetters==1){
flames="Sibling";
}
if(countLetters==0){
flames="Its Same Name";
}
res.innerHTML="<b style='color:green;'>"+document.getElementById("name2").value+"</b> is Your <b style='color:blue;'>"+flames+"</b>";
}else{
res.innerHTML="Please Enter Name";
}
}
44 changes: 44 additions & 0 deletions MultiPlayer - Games/Flames_Game/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
body{
background-image: url(Banner-image/bg.webp);
background-repeat: no-repeat;
background-size: cover;
}
.container{

height: auto;
display: flex;
justify-content: center;
align-items: center;
border: 5px solid;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
/* background-color:#F2ACB9; */
background-color: aliceblue;
padding: 50px;
}
input{
border: 5px solid #D2042D;
padding: 5px;
width: 500px;
margin: 5px;
}
h3{
margin: 10px;
font-family: cursive;
color: #D2042D;
font-size:2.5rem;
}
.btn{
border: 5px solid black;
background-color: whitesmoke;
color: black;
font-weight: bold;
}
.btn:hover{
border: 5px solid black;
background-color: grey;
color: black;
font-weight: bold;
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,12 @@ ________________________________________________________________________________
| 191 | [Doraemon Run](.SinglePlayer%20-%20Games/DoraemonRun) |
| 192 | [Hand_Cricket_Champ](./SinglePlayer%20-%20Games/Hand_Cricket_Champ) |
| 193 | [SnakeBites Game](./SinglePlayer%20-%20Games/SnakeBites) |


| 194 | [Ball_Shooting_Game](.SinglePlayer%20-%20Games/Ball_Shooting_Game) |
| 195 | [Baseball_Game](.SinglePlayer%20-%20Games/Baseball_Game) |
| 196 | [Flames_Game](../MultiPlayer%20-%20Games/Flames_Game) |




Expand Down
54 changes: 54 additions & 0 deletions additionalpage/multiplayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,60 @@ <h4 class = "text-white uppercase game-card-title">Pop My Balloon</h4>
</div>
</div>
<!--card end-->

<!-- card start -->
<div class = "game-card">
<div class = "game-card-top img-fit-cover">
<video src="video demonstration link of your game" link " type="video/mp4" muted loop class="clip" ></video>
<img src = "../assets/images/Flames-Game.png" alt = "">
<div class = "ratings-count">
45
<img src = "../assets/icons/star-black.svg" alt = "" class = "ms-2">
</div>
</div>
<div class = "game-card-bottom">
<div class="share-icon text-2xl" onclick="copyLink(this)">
<i class="fas fa-share-alt"></i>
<input type="hidden"
value="https://gamesphere-multiplayer.github.io/GameSphere/SinglePlayer%20-%20Games/link_to_the_html_file_for_your_game" />
<!--If there are spaces in your naming of folder, put %20 in between, ex:
link%20to%20the%html%file%20for%your&game-->

<!--The share link will be active only when it is deployed over website-->
</div>

<div class = "flex flex-col sm:flex-row justify-between items-start flex-wrap">
<div class = "py-1">
<h4 class = "text-white uppercase game-card-title">Flames-Game</h4>
<p class = "para-text">FLAMES is a fun game to predict relationships by using the initials of two people's names to determine if they will be Friends, Lovers, Affectionate, Married, Enemies, or Siblings</p>
</div>
<div class = "star-rating mt-2 sm:mt-0 py-1">
<img src = "../assets/icons/star-green.svg">
<img src = "../assets/icons/star-green.svg">
<img src = "../assets/icons/star-green.svg">
<img src = "../assets/icons/star-green.svg">
<img src = "../assets/icons/star-green-half.svg">
</div>
</div>
<div class = "block-wrap flex justify-between items-end">
<div class = "details-group">
<div class = "flex items-center">
<p class = "font-semibold">Release Date: &nbsp;</p>
<p>25.05.2024</p>
</div>
<div class = "flex items-center">
<p class = "font-semibold">Updated: &nbsp;</p>
<p>Action | Desktop</p>
</div>
</div>
<div class = "flex flex-col items-end justify-between">
<a target="_blank" href = "../MultiPlayer - Games/Flames_Game/index.html" class = "btn-primary uppercase">Play Now</a>
</div>
</div>
</div>
</div>
<!-- card end -->

</div>
</div>
</section>
Expand Down
Binary file added assets/images/Flames-Game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09980cc

Please sign in to comment.