Hangman gam

Developer
Size
2,611 Kb
Views
46,552

How do I make an hangman gam?

What is a hangman gam? How do you make a hangman gam? This script and codes were developed by Taha on 28 August 2022, Sunday.

Hangman gam Previews

Hangman gam - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>hangman gam</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <button class="click">new word</button>
<br>
<div class="section">
</div> <div class="letters"> <a>a</a><a>b</a><a>c</a><a>d</a><a>e</a><a>f</a><a>g</a> <a>h</a><a>i</a><a>j</a><a>k</a><a>l</a><a>m</a><a>n</a> <a>o</a><a>p</a><a>q</a><a>r</a><a>s</a><a>t</a><a>u</a> <a>v</a><a>w</a><a>x</a><a>y</a><a>z</a> </div>
<h1>yo</h1> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Hangman gam - Script Codes CSS Codes

.lines p {margin:0; opacity:0;}
button { bordeR:none; background:#eee; border-radius:5px; padding:1%; cursor:pointer;}
.click {float:left;}
.reset{float:right; position:fixed; right:100px;}
.lines{display:inline-block; border-bottom:3px solid crimson; margin:10px 10px; padding:2.5px 12px; background:#eee; font-size:1.5em;}
.letters
{ margin-top:50px;}
.letters a {margin:0 5px; background:rgba(0,0,0,0.7); padding:5px 10px;
color:white; border-radius:5px; font-size:1.5em; line-height:2;
cursor:pointer;}
.letters a:hover {background:crimson;}
.display h4 {opacity:0.5}
.lines .visible { opacity:1;
}
h1 { color:red;
}

Hangman gam - Script Codes JS Codes

var words = ["helicopter","selection","alphabet","raccoon","missippi"];
var wordDisplayed = 0;
/*var letterIndex = 0;
var letterSelected = 0;*/
$("button").click(function(){ var wordDisplayed = newWord();
});
function newWord(){ wordDisplayed = 0; $(".display").remove(); // remove previous word $(".letters a").css("opacity","1"); // display all letters to guess from var x = Math.floor((Math.random() * words.length)); //select a random number that will be index from array to selct word var randomWord = words[x]; $(".section").append("<div class='display'><h4> "+words.splice(x,1)[0]+" </h4></div>"); // display word on screen var splitWord = randomWord.split(""); //split the word into letters for ( var i = 0; i < randomWord.length; i++ ) // display letters on the screen	{	$(".display").append("<div class='lines'><p>"+splitWord[i]+"</p></div>");	} wordDisplayed = splitWord; return wordDisplayed;
} // end of newWord function
$(".letters a").click(function(){ var thisTag = $(this); thisTag.css("opacity","0"); guessWord(thisTag);
});
function guessWord(thisTag) { var letterSelected = thisTag.html(); var letterIndex = $.inArray(letterSelected,wordDisplayed);	if ( letterIndex > -1) { for (var i = 0; i < wordDisplayed.length; i++) { if (wordDisplayed[i] == letterSelected) { $(".lines p").eq(i).addClass("visible"); } } }
}
Hangman gam - Script Codes
Hangman gam - Script Codes
Home Page Home
Developer Taha
Username tkazi
Uploaded August 28, 2022
Rating 3
Size 2,611 Kb
Views 46,552
Do you need developer help for Hangman gam?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Taha (tkazi) Script Codes
Name
Wordsearch
Spotify api
Fluid containers
Topics with pictures
Youtube_api
Tie
Vogel.photo
A Pen by taha
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!