The Daily Click ::. Forums ::. Klik Coding Help ::. Need help with hangman game coding!
 

Post Reply  Post Oekaki 
 

Posted By Message

hozz



Registered
  22/09/2002
Points
  320
16th May, 2006 at 01:12:54 -

Hey, Im attempting to create a hangman game, and so far I have drawn all my graphics and got everything I need in place. All I need now is to code all the events. I used to create games using TGF way back in the day, but I have mostly forgotten how to do it all. Could anyone help me out as to tell me how I should code it? Basically I have all the individual parts of the man and the neccessary letters set to invisible, and when the player presses a key that is in the word, the letter becomes visible, and when a key is pressed that is not in the word, a certain piece of the man becomes visible. Unfortunatly I am having a lot of trouble with it. Could anyone help me out here? You all know how hangman goes...

Thanks.

Image Edited by the Author.

 
goodbye

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
16th May, 2006 at 08:49:23 -

Rather than trying to do it directly with the on-screen objects, I'd use a counter/alterable value to keep track of how many pieces of the man should be visible, and update the objects using the value of the counter.

For letters appearing, you could either use an Edit object and continually check to see if there's anything in it, then react based on the letter there (use GetText$("Edit")), or you'd have to have a large number of "User presses key" events. Well, 26. Anyway, if any letters that match the entered letter exist on the screen, display them - if not, increment the counter.

 
http://www.davidn.co.nr - Games, music, living in America

vortex2



Registered
  27/05/2002
Points
  1406
16th May, 2006 at 22:21:02 -

http://www.clickteam.com/CTforum/showflat.php3?Cat=&Board=upload&Number=298779&page=0&view=collapsed&sb=5&o=&part=&vc=

 
A bit of insanity with every bite!

hozz



Registered
  22/09/2002
Points
  320
16th May, 2006 at 23:32:05 -

Sorry david, I'm still unsure how to do all that. I'm using TGF by the way, that link was for MMF. Do you think one of you could quickly whip up an example of a hangman game for TGF, so I can download it and check out the coding? This is for a college project actually, and is due by monday week. Any help is greatly appreciated.

 
goodbye

vortex2



Registered
  27/05/2002
Points
  1406
17th May, 2006 at 01:06:26 -

Well monday isn't a big time frame....... why not update to MMF and then the engine is coded for you?

My engine won't transfer to TGF......

 
A bit of insanity with every bite!

Spiriax



Registered
  25/05/2005
Points
  277
17th May, 2006 at 04:16:43 -

I have a Hangman engine finished in about an hour or so in TGF. You still need one?

Image Edited by the Author.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
17th May, 2006 at 13:06:18 -

I made a hangman game not long ago. Not released it yet, thought I'd make a hiscore board for it and something first.

I think I just used a loop to split the word, so that each letter is represented by a line in a list object, and then used FindStringExact to search for a letter. Then I did something like running another loop that replaced each unknown letter with "_" and then printed the string out onto the screen.

It's really not hard at all if you know what you're doing.

Oh, and if you need words for it, just google around for something like "list of common English words". That's what I did for my game

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click