So i have this Hangman project due this week. It's suppose to be evil, but i already got that part down(Evil as in keeping the player from winning for as long as possible). There should be 5 Lives. I didn't implement the lives yet. For those 5 lives though, i did make 5 sprites. The Head, body, arms(both together on one spirte), the right leg, and the left leg. Each life taken should make a body part appear. There are 30, 5 letter words in a list that i made called "List of Words". If letter is guessed correctly, that letter should appear in one of the 5 given places. For the letters, i have created 5 separate sprites for each letter, and within those sprites are costumes that are A-Z. I just started doing these type of projects this year, so if you have some constructive criticism you would like to give, i am more than open to them.
Variables i used:
Index
Letter
List Index
Lives
Variable
Word Index
My script so far is below. Note that what i have so far is what makes the script Evil. Like i said above, what makes the script evil is keeping the player from winning for as long as possible, which i have already done below. Now i just need original hangman. My teacher saw my script, and said that i should implement it between the "if else" statement under the If. Thank you for all the help contributed!
repeat until <(length of [possible words v]) = (1)> ask [letter?] and wait repeat until <(length of (answer)) = (1)> ask [letter?] and wait end set [list index v] to (length of [possible words v]) repeat until <(list index) = (0)> set [word index v] to (1) repeat until <<(letter (word index) of (item (list index) of [possible words v])) = (answer)> or <(word index) > (length of (item (list index) of [possible words v]))>> change [word index v] by (1) end if <(letter (word index) of (item (list index) of [possible words v])) = (answer)> else //teacher saw script and said that i should implement hangman under the if else statement. delete (list index) of [possible words v] end change [list index v] by (-1) end end
Offline
that's clever
Offline