Risk in Flash
Over the past Winter Break, I taught myself Flash thanks to a video training series from Lynda.com (which I highly recommend). I didn’t get all the way through the series actually — I got up to the point where the instructor teaches you how to make a Memory game. Needless to say, it was a fairly simple example and I wasn’t feeling very satisfied after expanding my Memory game beyond the example.
I decided to do what any aspiring Flash programmer would do — make a game. Because I was lacking in creativity, I decided to recreate a game that already existed. I had always been toying with the idea of making a Risk game on the computer, and Flash seemed to be the perfect environment for it. I spent the next three or four days hacking away. Most of the code was very repetitive, like where I define the neighbors of each country. However, for the most part, Flash made the usually hard things very easy — things like animating the dice rolls for pseudo battles and actually creating the board were not hard to do at all. I also came to appreciate how close Actionscript 3.0 is to Java (and more specifically Javascript), especially with it’s object-orientation.
The result of my messing around is a hopefully fully functional Risk game. There is no AI implemented, but it supports multiple players. Also, the nature of the programmatic dice rolling should cut a lot of time from the game, making it possible to play a round with 6 players in around 45 minutes.
Click here to play the game. (I recommend you play in full screen, since the game interface doesn’t fit well in a browser. Press F11 in your browser to enter full screen mode. )