Scheduled Maintenance: 10-11-2025 Electricity company maintenance between 09:00 and 15:00.

3.1.x Extensions Database 3.1 / 3.2Hangman Game

<span class="qte-attr qte_31_32-qte">3.1.x &amp; 3.2.x</span>
User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Hangman Game

Post by dmzx »

Extension Name: Hangman Game
Author: dmzx and special thanks to Sniper_E

Extension Description::

phpBB 3.1 extension Hangman Game



Screenshots:
Image
Image

Extension Download:
Download-link
Hangman Game
Installation:
  1. Download the latest release.
  2. Unzip the downloaded release, and change the name of the folder to `hangman`.
  3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist).
  4. Copy the `hangman` folder to `/ext/dmzx/` if done correctly, you'll have the main extension class at
    (your forum root)/ext/dmzx/hangman/composer.json
  5. Navigate in the ACP to `Customise -> Manage extensions`
  6. Look for `Hangman Game` under the Disabled Extensions list, and click its `Enable` link.

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Linux Chrome

Re: [DEV] Hangman Game

Post by martin »

Works good but location is wrong i would place it in a pop up link in navbar then pop out :thumbup:

few other games area53 at die Muellers dot Org • Index page
Image

User avatar

Sot2015
Users
Users
Posts: 2
Joined: 21 Jan 2015, 14:35
    Windows 7 Firefox

Re: [DEV] Hangman Game

Post by Sot2015 »

It's not calling the images as you play the game, what do I need to fix?

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: [DEV] Hangman Game

Post by dmzx »

Sot2015 wrote:It's not calling the images as you play the game, what do I need to fix?
Open: ext\dmzx\hangman\styles\all\template\event\overall_footer.html
Find 3x This may be a partial find and not the whole line

Code: Select all

../ext/dmzx/hangman
Replace with Replace the preceding lines with the following

Code: Select all

{BOARD_URL}/ext/dmzx/hangman

User avatar

Sot2015
Users
Users
Posts: 2
Joined: 21 Jan 2015, 14:35
    Windows 7 Firefox

Re: [DEV] Hangman Game

Post by Sot2015 »

Ok, that fixed it. Thanks, and thanks for fast reply

User avatar

ninowebs
Users
Users
Posts: 29
Joined: 04 Jun 2015, 23:44
    Windows 7 Chrome

Re: [DEV] Hangman Game

Post by ninowebs »

Information ,,, but this extension does not by then a ranking?

tnk :tumbsyes:

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Windows 8 Chrome

Re: [DEV] Hangman Game

Post by martin »

New body has a few small fix's got it down to 1 html5 error from 5
Test this new body :eyes2: Test the old body

The name attribute on the img element is obsolete. Use the id attribute instead.
<p><img src="{ROOT_PATH}ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif" height="150" width="150" name="hm" alt=""></p>
should be
<p><img src="{ROOT_PATH}ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif" height="150" width="150" id="hm" alt=""></p>

but that breaks the game in chrome

Code: Select all

<!-- INCLUDECSS @dmzx_hangman/hangman.css -->
<!-- INCLUDE overall_header.html -->

<form name="frm">
 <div style="forabg">
   <h2>{L_HANGMAN_TITLE}</h2>
   <table>
   <tr>
    <td></td>
    <td>
     <p><img src="{ROOT_PATH}ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif" height="150" width="150"  name="hm" alt=""></p>
    </td>

      <td>
      <table>
       <tbody>
         <tr>
         <td>{L_HANGMAN_TENLIVES}<br>
         {L_HANGMAN_SCORE}
          <input type="text" size="2" onfocus="score.blur();" value="0" name="score"> {L_HANGMAN_LIVES_USED}
          <input type="text" size="2" onfocus="lives.blur();" value="0" name="lives">
          <input class="nq" type="button" value="{L_HANGMAN_NEW_QUOTE}" onclick="new_word(this.form);">
          <input class="nq" type="button" disabled="disabled" value="{L_HANGMAN_RESTART}" onclick="restart(this.form);" name="res">
         </td>
         </tr>
       </tbody>
      </table>
      </td>
   </tr>

</table><br>

<table class="navbar">
 <tr>
   <td>
   <br>
   <textarea class="tarea" onfocus="word.blur();" name="word" cols="81" rows="1">   {L_HANGMAN_NEW_QUOTE_START}</textarea>
   <br>
   <br>
   {L_HANGMAN_FAILED_TRIES}
   <input type="text" size="25" onfocus="tried.blur();" value="" name="tried">
   {L_HANGMAN_CORRECT_TRIES}
   <input type="text" size="30" onfocus="tried.blur();" value="" name="correct">
   <br>
   <br>
   </td>
   </tr>
</table><br>

<div>
  <table style="margin: 0 auto;">
   <tbody>
   <tr>
   <td><input type=button id='A' value=" A "   onclick="seek('A');" class=alpha-butt></td>
   <td><input type=button id='B' value=" B "   onclick="seek('B');" class=alpha-butt></td>
   <td><input type=button id='C' value=" C "   onclick="seek('C');" class=alpha-butt></td>
   <td><input type=button id='D' value=" D "   onclick="seek('D');" class=alpha-butt></td>
   <td><input type=button id='E' value=" E "   onclick="seek('E');" class=alpha-butt></td>
   <td><input type=button id='F' value=" F "   onclick="seek('F');" class=alpha-butt></td>
   <td><input type=button id='G' value=" G "   onclick="seek('G');" class=alpha-butt></td>
   <td><input type=button id='H' value=" H "   onclick="seek('H');" class=alpha-butt></td>
   <td><input type=button id='I' value=" I "   onclick="seek('I');" class=alpha-butt></td>
   <td><input type=button id='J' value=" J "   onclick="seek('J');" class=alpha-butt></td>
   <td><input type=button id='K' value=" K "   onclick="seek('K');" class=alpha-butt></td>
   <td><input type=button id='L' value=" L "   onclick="seek('L');" class=alpha-butt></td>
   <td><input type=button id='M' value=" M "   onclick="seek('M');" class=alpha-butt></td>
   </tr>
   <tr>
   <td><input type=button id='N' value=" N "   onclick="seek('N');" class=alpha-butt></td>
   <td><input type=button id='O' value=" O "   onclick="seek('O');" class=alpha-butt></td>
   <td><input type=button id='P' value=" P "   onclick="seek('P');" class=alpha-butt></td>
   <td><input type=button id='Q' value=" Q "   onclick="seek('Q');" class=alpha-butt></td>
   <td><input type=button id='R' value=" R "   onclick="seek('R');" class=alpha-butt></td>
   <td><input type=button id='S' value=" S "   onclick="seek('S');" class=alpha-butt></td>
   <td><input type=button id='T' value=" T "   onclick="seek('T');" class=alpha-butt></td>
   <td><input type=button id='U' value=" U "   onclick="seek('U');" class=alpha-butt></td>
   <td><input type=button id='V' value=" V "   onclick="seek('V');" class=alpha-butt></td>
   <td><input type=button id='W' value=" W "   onclick="seek('W');" class=alpha-butt></td>
   <td><input type=button id='X' value=" X "   onclick="seek('X');" class=alpha-butt></td>
   <td><input type=button id='Y' value=" Y "   onclick="seek('Y');" class=alpha-butt></td>
   <td><input type=button id='Z' value=" Z "   onclick="seek('Z');" class=alpha-butt></td>
   </tr>
   </tbody>
   </table>
   </div>
   </div>
 </form>
<!-- INCLUDE overall_footer.html -->

User avatar

peteetongman
Users
Users
Posts: 44
Joined: 03 Jan 2015, 20:46
    Windows 7 Firefox

Re: Hangman Game

Post by peteetongman »

Hey guys, how hard would it be to add new quotes to Hangman? I have some members who play it so much they have all the current quotes memorized :question:

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 8 Firefox

Re: Hangman Game

Post by dmzx »

peteetongman wrote:hey guys, how hard would it be to add new quotes to Hangman? I have some members who play it so much they have all the current quotes memorized :question:
Just add them here hangman/overall_footer_after.html at master · dmzx/hangman · GitHub

User avatar

peteetongman
Users
Users
Posts: 44
Joined: 03 Jan 2015, 20:46
    Windows 7 Firefox

Re: Hangman Game

Post by peteetongman »

dmzx wrote:
peteetongman wrote:hey guys, how hard would it be to add new quotes to Hangman? I have some members who play it so much they have all the current quotes memorized :question:
Just add them here hangman/overall_footer_after.html at master · dmzx/hangman · GitHub
excellent! thanks!

User avatar

peteetongman
Users
Users
Posts: 44
Joined: 03 Jan 2015, 20:46
    Windows 7 Firefox

Re: Hangman Game

Post by peteetongman »

dmzx wrote:
peteetongman wrote:hey guys, how hard would it be to add new quotes to Hangman? I have some members who play it so much they have all the current quotes memorized :question:
Just add them here hangman/overall_footer_after.html at master · dmzx/hangman · GitHub
I have a complete set of new quotes on my site I can send or feel free to steal them from the site ;-)

User avatar

martin
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Linux Chrome

Re: Hangman Game

Post by martin »

Post them here i'm sure there get used. :tumbsyes:

User avatar

ninowebs
Users
Users
Posts: 29
Joined: 04 Jun 2015, 23:44
    Windows 7 Chrome

Re: Hangman Game

Post by ninowebs »

Thanks for the info , I wonder if there is the possibility of having a ranking for users , thanks again

User avatar

vla20071
Users
Users
Posts: 29
Joined: 28 Jun 2015, 20:26
    Mac OS X Chrome

Re: Hangman Game

Post by vla20071 »

Game in mobile version:
Image

Slightly altered:
Image
Image Image
dmzx-hangman.zip

Version for Russia (modified keyboard, added about 300 words)
Image
dmzx-hangman-ru.zip
I helped CabinetAdmin
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.

User avatar

peteetongman
Users
Users
Posts: 44
Joined: 03 Jan 2015, 20:46
    Ubuntu Chrome

Re: Hangman Game

Post by peteetongman »

martin wrote:post them here i'm sure there get used. :tumbsyes:
here's a file of movie titles if you want to switch things up. Most of these are US movies I think so I guess they may not be relevant in some areas of the world. I have another one with Zoo Animals and another with 1960's Songs also

Code: Select all

<script type="text/javascript">
//<![CDATA[
var alpha=new Array();
var alpha_index=0;

var bravo=new Array();
var bravo_index=0;

var running=0;
var failnum=0;
var advising=0;

var words = new Array("The Godfather",
					 "The Shawshank Redemption",
					 "Schindlers List",
					 "Raging Bull",
					 "Casablanca",
					 "One Flew Over the Cuckoos Nest",
					 "Gone with the Wind",
					 "Citizen Kane",
					 "The Wizard of Oz",
					 "Titanic",
					 "Lawrence of arabia",
					 "The Godfather Part II",
					 "Psycho",
					 "Sunset Blvd",
					 "Vertigo",
					 "On the Waterfront",
					 "Forrest Gump",
					 "The Sound of Music",
					 "West Side Story",
					 "Star Wars",
					 "E T The Extra Terrestrial",
					 "A Space Odyssey",
					 "The silence of the Lambs",
					 "Chinatown",
					 "The Bridge on the River Kwai",
					 "Singin in the Rain",
					 "Its a Wonderful Life",
					 "Some Like It Hot",
					 "Twelve Angry Men",
					 "Dr Strangelove",
					 "Amadeus",
					 "Apocalypse Now",
					 "Gandhi",
					 "The Lord of the Rings",
					 "Gladiator",
					 "From Here to Eternity",
					 "Saving Private Ryan",
					 "Unforgiven",
					 "Raiders of the Lost Ark",
					 "Rocky",
					 "A Streetcar Named Desire",
					 "The Philadelphia Story",
					 "To Kill a Mockingbird",
					 "An American in Paris",
					 "The Best Years of Our Lives",
					 "My Fair Lady",
					 "Ben Hur",
					 "Doctor Zhivago",
					 "Patton",
					 "Jaws",
					 "Braveheart",
					 "The Good the Bad and the Ugly",
					 "Butch Cassidy and the Sundance Kid",
					 "The Treasure of the Sierra Madre",
					 "The Apartment",
					 "Platoon",
					 "High noon",
					 "Dances with Wolves",
					 "The Pianist",
					 "Goodfellas",
					 "The Exorcist",
					 "The Deer Hunter",
					 "All Quiet on the Western Front",
					 "The French Connection",
					 "City Lights",
					 "The Kings Speech",
					 "It Happened One Night",
					 "A Place in the Sun",
					 "Midnight Cowboy",
					 "Mr Smith Goes to Washington",
					 "Rain Man",
					 "Annie Hall",
					 "Good Will Hunting",
					 "Terms of Endearment",
					 "Tootsie",
					 "Fargo",
					 "The Grapes of Wrath",
					 "The Green Mile",
					 "Close Encounters of the Third Kind",
					 "The Graduate",
					 "American Graffiti",
					 "Pulp Fiction",
					 "The African Queen",
					 "Bonnie and Clyde",
					 "Mutiny on the Bounty");

function pick()
{
	var choice="";
	var blank=0;

	for(i=0; i<words[index].length; i++)
	{
		t=0;
		for(j=0; j<=alpha_index; j++)
			if(words[index].charAt(i)==alpha[j] || words[index].charAt(i)==alpha[j].toLowerCase()) t=1;

		if(t) choice+=words[index].charAt(i)+" ";
		else
		{
		  if(words[index].charAt(i)==' ')
		  {
		  	choice += "  ";
		  }
		  else
		  {
				choice+="_ ";
			blank=1;
		  }
		}
	}

	document.frm.word.value=choice;

	if(!blank)
	{
		alert('{LA_HANGMAN_YOUWIN}');
		document.frm.score.value++;
		running=0;
		new_word(document.frm);
	}
}

function new_word(form)
{
	if(!running)
	{
		running=1;
		failnum=0;
		form.lives.value=failnum;
		form.tried.value="";
		form.correct.value="";
		form.word.value="";
		index=Math.round(Math.random()*10000) % 100;
		alpha[0]=words[index].charAt(0);
		alpha[1]=words[index].charAt(words[index].length-1);
		alpha_index=1;
		bravo[0]=words[index].charAt(0);
		bravo[1]=words[index].charAt(words[index].length-1);
		bravo_index=1;
		pick();
	}
	else
		advise("{LA_HANGMAN_QUOTE_ALREADY}");

	document.frm.res.disabled=false;
	document.frm.hm.src="../ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif";

	for(var i=65; i<=90; i++)
		document.getElementById(String.fromCharCode(i)).style.backgroundColor='#D3D3D3';
}

function restart(form)
{
	running=1;
	failnum=0;
	form.lives.value=failnum;
	form.tried.value="";
	form.correct.value="";
	form.word.value="";
	index=Math.round(Math.random()*10000) % 100;
	alpha[0]=words[index].charAt(0);
	alpha[1]=words[index].charAt(words[index].length-1);
	alpha_index=1;
	bravo[0]=words[index].charAt(0);
	bravo[1]=words[index].charAt(words[index].length-1);
	bravo_index=1;
	pick();
	document.frm.hm.src="../ext/dmzx/hangman/styles/all/theme/images/hmstart3.gif";

	for(var i=65; i<=90; i++)
		document.getElementById(String.fromCharCode(i)).style.backgroundColor='#D3D3D3';
}

function seek(letter)
{
	if(!running)
		alert("{LA_HANGMAN_NEW_QUOTE_TO}");
	else
	{
		t=0;
		for(i=0; i<=bravo_index; i++)
			if (bravo[i]==letter || bravo[i]==letter.toLowerCase()) t=1;

		if(!t)
		{
			bravo_index++;
			bravo[bravo_index]=letter;

			for(i=0;i<words[index].length;i++)
				if(words[index].charAt(i)==letter || words[index].charAt(i)==letter.toLowerCase()) t=1;

			if(t)
			{
				alpha_index++;
				alpha[alpha_index]=letter;
				document.frm.correct.value+=letter+" ";
			  		document.getElementById(letter).style.backgroundColor='#FFF8DC';
			}
			else
			{
				failnum++;
				document.frm.tried.value+=letter+" ";
				eval("document.hm.src=\"../ext/dmzx/hangman/styles/all/theme/images/hm" + failnum + ".gif\"");
			  		document.getElementById(letter).style.backgroundColor='#CCD8FF';
			}

			document.frm.lives.value=failnum;

			if(failnum==10)
			{
				alert('{LA_HANGMAN_YOU_LOSE}');
				document.frm.score.value--;
				running=0;
				new_word(document.frm);
			}
			else pick();
		}
		else
			advise("{LA_HANGMAN_LETTER} "+letter+" {LA_HANGMAN_ALREADY_USED}");
	  }

}

function advise(msg)
{
	if(!advising)
	{
		advising=-1;
		savetext=document.frm.correct.value;
		document.frm.correct.value=msg;
		window.setTimeout("document.frm.correct.value=savetext; advising=0;",500);
	}
}
//]]>
</script>
Last edited by peteetongman on 11 Oct 2015, 18:12, edited 2 times in total.

Locked Previous topicNext topic