FlashPunk is an ActionScript 3 library, meaning it is not a piece of software or single program, but rather a huge collection of ActionScript 3 (.as) files that contain helpful code for setting up your games, rendering different types of graphics, resolving in-game collisions between objects, and much, much more. In order to use it, you’re doing to have to download the library and import it into your projects.
There are two ways to get FlashPunk into your project. First, head over to the download page.
Using the source folder
This is the method you’ll want to use if you have any intentions of hacking the code yourself. Click the button that says “Source code (zip”) and download the archive.
If you’ve followed the Setting up FlashDevelop tutorial, you know how to start a new basic AS3 Project and compile it. To add FlashPunk into your current project, first extract the archive you downloaded. Contained should be a folder called net; everything within that folder is FlashPunk. Copy that whole net folder into your project next to your Main.as class. Once you’ve done that, your project directory (relative to Main.as) should look like this:
net/
flashpunk/
debug/
graphics/
masks/
tweens/
utils/
Engine.as
Entity.as
FP.as
...etc.
Main.as
Using the Adobe class library
Thanks to @Ultima2876 for contributing these steps!
Click the button that says “flashpunk-1.x.x.swc” and download the file.
Copy the downloaded SWC file into your project folder (you can create a ‘lib’ folder if you like, or just put it in the root directory - no need to extract the swc file itself as this is its own self-contained library package!)
From within FlashDevelop’s project explorer, right click the swc file and choose ‘add to library’.
Once you’ve got that all set up, you’re ready to proceed to FlashPunk Basics!