Click here to play Spurs Hangman.
Spurs Hangman is a fleshed out version of my previous Hangman assignment, focusing on NBA and Spurs-related words. My game incorporates a lot of silver, white, and black; Spurs colors. The Coyote was a late addition to the product that I think adds a bit of whimsy and personality that was lacking. The sounds are basketball-related, and the buttons look like basketballs. The scoreboard; which incorporates the round, score, and fouls (the game’s equivalent to the actual hanging stick figure of the original).
The game challenges players to play through 4 rounds (quarters) before fouling out by guessing six incorrect letters. At the completion of each quarter, players are awarded points based on how many incorrect guesses they had during the quarter. At the end of the four quarters, the players can admire their final score for the game and soak in the cheers of their adoring fans before starting anew.
One key addition to this game was the use of keyboard inputs. Players can still use onscreen buttons to guess letters, but those who would rather use a keyboard can now do so as well. I didn’t have too much trouble setting up a loop to detect the inputs, and a little light Googling had me converting the pressed key to upper case and assigning it to my letter storage variable. My major difficulty was in disabling individual letters after pressing the key, so that players wouldn’t be charged with a foul for repeating a letter. After toying around with a used letter array and struggling, I ended up using 26 Boolean variables to register whether each key was pressed, which worked like a charm.
Another challenge, albeit one unrelated to Actionscript itself, was Flash’s inability to detect newly-installed fonts on my computer, which prevented me from implementing the scoreboard font you see in the final game. A quick Google search of the issue seems to indicate it’s a problem specific to Macs, and there wasn’t one cut and dry solution that worked for everyone. I essentially ended up manually moving my entire font library to a temporary folder on my computer, rebooting, and adding them back. For some reason this did the trick.
One of my goals for this assignment was to add a button that could post the score to Facebook. I looked into it, and came to the conclusion that I would be getting in way over my head. Hopefully this is the kind of thing I can teach myself in the future, but right now I’m not prepared to hook my simple games into web API’s.
UPDATE: At the suggestion of a few friends, I added a new “clues” array that spits out a unique clue for each word in the dictionary to make the game a little easier. I had trouble getting a font to embed for my clueBox, and I think my attempt at embedding made the FLA balloon to 24MB (I deleted the unused fonts, it’s still that big), but otherwise this wasn’t a major technical hurdle.
There were other additions I made to the game, but few that put up much of a challenge. I felt throughout that my experiences with the Trivia and Dungeon Maze assignments were all helpful, even if at a subconscious level, when writing the new code for this game. This was a lot of fun to make, and I’m happy with how it turned out. I’m going to try to get it on Spurs.com sometime soon.