Help with hangman game please..

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Help with hangman game please..

Postby mercedes » Sun Aug 03, 2008 11:28 am

Hi there...:)



I am making a mini game of hangman..And so far i have it so the letters that are in the puzzle..simply load in a hotspot..when they click on the letters..I think that this part is ok..i beleive..

What i need help with is;

How do i make it so when the user clicks on a letter that isn't in the puzzle..that the head or legs and so on...load up..So if they pick the letter C..how do i avoid making it so the letter C isn't the only one that loads the head..but could also load the legs and so on..as well as other letters..depending on where they are at in the puzzle...

I know I have to make variables with the body parts..I don't think I have to with letters..:?..Just wondering on how to start the statement or which function to use that would work best..


Also they have a place that they can guess the whole thing before the finish the puzzle..Ive made a textbox..


Last thing...They only have 6 guesses so to speak..how do i make it so Once they guess all 6guesses..that they have to start over..?...clear the board so to speak..


Many Thanks..


Its a tall order...:oops:


Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Sun Aug 03, 2008 12:43 pm

Starting from the last. Create a hotspot button next to the textbox, then add the code that checks for the word and make it so that there's a variable increasing every time:
Code: Select all
guesses=guesses+1


About the rest of the game:
Make the user insert the letter into a textbox rather than clicking the letters.
Then check the word using this code:
Code: Select all
Numofletters=Len(word)
For i=1 to numofletters
if input=Mid(word,i,1) then
rightletters=rightletters+1
else
falseletters=falseletters+1
Next

To load the parts of the hangman, change the values of the variables they need to appear depending on the falseletters value (ex: falseletters=1 -> head=1, falseletters=2 -> head=1, body=1


Hope this helps.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Sun Aug 03, 2008 9:01 pm

Code: Select all
guesses=guesses+1


Is that it..with the button that checks word....no other coding somewhere else or variables..?



Code: Select all
Numofletters=Len(word)
For i=1 to numofletters
if input=Mid(word,i,1) then
rightletters=rightletters+1
else
falseletters=falseletters+1
Next


To load the parts of the hangman, change the values of the variables they need to appear depending on the falseletters value (ex: falseletters=1 -> head=1, falseletters=2 -> head=1, body=1


I'm not sure I understand you here..:( and is there no way to keep the alphabet there..? like another way...

I like the look of letters..I worked hard on those letters man.... LOL..It doens't look like hangman without them ....:(...

See i have it set up with the puzzle like this and the alphabet is there with the one text box to guess the whole thing..

_ _ _ _ _ _ _/ _ _ _ _ _ _/


If it's a pain...I totally understand..I do shoot high sometimes...LOL..


Peace..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Mon Aug 04, 2008 10:29 am

Of course you have to declare the global integer guesses.

Anyways. what I was thinking of is a hangman that features a text text (that means no pics for letters but actual letters.)

I will now explain the code (that is now fixed)
Code: Select all
Numofletters=Len(word) 'this retrieves the number of the letters in the string word
numofrights=rightletters
For i=1 to numofletters 'creating a loop that is based on the number of the letters
if input=Mid(word,i,1) then 'checking through the word to find the char that you want
rightletters=rightletters+1 'increase the right letters count
End if
Next
If numofrights=rightletters then 'if the right letters hasn't been increased
wrongletters=wrongletters+1 'increase the wrong letters count


Don't forget to declare the global ints rightletters and wrongletters.
In the button checking for the right letters, add a code like this one:
Code: Select all
Select case wrongletters
case 1
head=1
case 2
head=1
body=1
case 3
'etc
End Select


To reveal the letters found, you need a code like this one:
Code: Select all
Do
lettersfound=0
numofletters=Len(word)
for i=1 to ubound(word)
If Mid(word,i,1)=letterseeking then
lettersfound=lettersfound+1
letterposition=i
Next
previousletters=""
If letterposition>1 then
previousletters=Mid(word,1,letterposition-1)
End if
afterletters=Mid(word,letterposition+1,Len(word)-letterposition)
word=previousletters+letterseeking+afterletters
Loop  until lettersfound=1

Ooof
Over at last... took me quite a time.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Mon Aug 04, 2008 7:13 pm

Hey Kiddo..

This is perfect..but it looks like we may have a different idea of what the frame should look like...

Is there anyway you can put a zip here..so as i can take a look at it..:oops:

I'm unsure where to put everything..
Thanks so much by the way...!!~

Very cool of you..to do all that work..


Peace~!
Adieux
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Mon Aug 04, 2008 8:56 pm

Mercedes, you know more than everyone that helping and coding is my life :P.

Anyway I 'm gonna upload a sample when I have time to create one.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Mon Aug 04, 2008 8:59 pm

Awesome..!!


Thanks!~ I appreciate all the work you've done~

It helps me better understand to see where it all goes..I appreciate that..:)



Peace~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Tue Aug 05, 2008 10:29 am

well, it isn't going well...
I 'm uploading the file to let everyone help
Attachments
hangman.zip
zip version
(103.49 KiB) Downloaded 296 times
hangman.rar
(95.46 KiB) Downloaded 308 times
Last edited by Lyberodoggy on Wed Aug 06, 2008 11:22 am, edited 1 time in total.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Wed Aug 06, 2008 1:42 am

Oh, thats too bad...:(...Sorry to hear of that..with all the work you put it..


Thanks anyways Kiddo~ for all of your efforts..:)



Peace~
Adieux
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Wed Aug 06, 2008 11:23 am

Added a zip version.

Mercedes don't give up on this one I ll try to fix it, but you have to try too.

And BTW you GOT to get WinRar :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby mercedes » Wed Aug 06, 2008 8:59 pm

LOL..yes I know..It's only ever Trial Versions out though..for WinRar..I like JustZipIt cause its soo easy..and faster and its yours forever..:lol:

But I will upload project right now and look at it..:)

Hope we can figure this out..!


EDIT...

Can't do it..can't figure it out...:( Do think we can work with what i have now instead maybe..?..I have done it differently..perhaps it could be a little easier to work with..the code u have in the frame is right..its whats in the hotspot to check the word is where the error is..i beleive..

The only thing I can tell you is..I see whats wrong with it..Only I don't know how to fix it..:(

To spell the word i am able to spell it backwards...Starting from S..but as soon as i get to third E..it gives me the error..I can only do E twice..Also whats wierd is that i can guess M the whole way through it and it take away all of the lines..[letters]..No other letter will do that..only M..

****************************************************************************
What I have done is differently..i was hoping for a code though that would make TEXT appear in the puzzle of lines..Once the user clicks on a picture of an A or T lets say...and have the A or T appear as TEXT in the lines.

Also thinking of a huge IF statement with wrong letters..only using the actual wrong letters..up to 6 guesses of body parts..so like this maybe

If C_clicked then action.loadapicture hotspot(), " head.gif"
but if Head is = 1 then loadapicture hotspot(), "body.gif"
If body is equal to 1 then..load a picture..So basically if they hit 6 guessses..by the 6th one..nothing happens..only a message.."You are out of guesses"

Or give the user no choice but to hit RESET..cause nothing else happens..and do this with all wrong letters..as opposed to having a "wrong letters" variable...make the letters the variables instead..As well as body parts..

Do you know what I mean..? does this make sense or am i barking up the wrong tree here..:? I may have worked on t his too long and have confused myself even more..:cry:






I'll pm you..

Ttus
Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron