Flash & AS3 info, source, & experiments
Archive for May 18, 2007
ActionScript 3 Data Structures
May 18th
I’ve been longing to re-create the Zelda Arena game I created a while back in AS 3 (under a different title so I don’t get sued by Nintendo), and actually finish the project (feature-complete) and post it online where multiple people could go up against each other on a single server. My dreams for the game might be larger than my spare time allows (it seems like I don’t even know what ‘spare time’ means lately), but I think I’ll take a shot at it and see what happens.
In order to do it properly and write some decent AI, I’ll need some good Graph and Tree data structures written in ActionScript 3. I was about to pull out all of my old C++ code for these structures that I wrote back in college and port ‘em over, until I noticed Michael Baczynski of Polygonal Labs did all the work for me! He called it AS3 Data Structures for Game Developers and, so far, has included the following structures:
- Multi-Dimensional Arrays (2d and 3d, native)
- Queue
- Stack
- Tree
- Binary Tree
- Binary Search Tree
- Hash Table
- Linked Lists
- Heap
- Priority Queue
- Graph
- Bit Vector
Although I haven’t begun to use them extensively yet, all of the features that I desire seem to be there. The code looks pretty good, both from an efficiency and a design pattern point of view. Everything has ASDoc supported comments. He even has a nice tutorial on using the Tree Class and it seems he might be adding more tutorials later. Nice work Michael!
You can download the structures here:
