Final Project – Goblins

So it’s finally done. My project is a little whimsical, I will admit, but it was fun and it turned out great. I came up with my project because of the discussions that we had in class last Thursday and the fact that my friend uses many tokens in his Magic the Gathering deck. His tokens are goblins, so I wanted to make something that could keep track of the goblins, since we lose track a lot, and could make the goblins seem funnier. In all honestly, this project is kind of a jab at his play style since it annoys me and I just generally don’t like it. Still, this project has been very very fun and worked out great.

My program is a random generation program that makes randomly positioned goblins depending on the count of goblins. You would use the left and right keys to subtract and add goblins, while the up key would make them run across the screen and attack. Each time you click one of the keys the goblins are all repositioned allowing for the creation of some very random and interesting configurations that can be some really cool images. There was even one time where I could have sworn that the string of variations spelled out goblin.

The code wasn’t too complex, but there were a few problems in getting things to work. The first problem was getting the string at the top to display a number since all references online where just consistent and never changing. This was solved by making the string a variable so that it would change with the value. The second, and by far the most annoying problem that I ran into was getting the run function to activate on a key press. This problem was solved thanks to Dennis by changing the key press functions to run and change a button value instead of actually pressing the key to run the function. This way the running function could be in the draw section allowing it to actually work and run multiple times instead of just once like it was in the key pressed section. So thank you Dennis.

The video of it being used is at http://www.youtube.com/watch?v=8mjAWM6mmAE&feature=youtu.be

Thanks. It was a great class and term.

Leave a Reply