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...
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.
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.
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