@McFunkypants I used to get SO EXCITED ABOUT THESE but then it just felt like I was doing some high schooler's homework for them haha (Today)

@DanFessler r i p (Today)

That's when I truly realized we were... *turns to the camera* The Last of Us: Part 2. (Today)

@MANvsGAME t.co/xGmqqc9LyB (Yesterday)

@ShawnWhite aquadome amazes me. like how did that map make it through testing? i can barely see whats going on in it -_- (Yesterday)

@TimothyFitz excuse me what the FrankerZ did you just say to me you little FrankerZ I graduated top of my class Shooting Star Division 3 (Yesterday)

new rocketleague update has map like/dislikes cant wait to see if the dislike levels for tokyo and wasteland are as high as i think they are (Yesterday)

@TeddyDief pineapple jalapeno pepperoni is my go to za (2 days ago)

@AsherVo what an emotional rollercoaster (2 days ago)

@ADAMATOMIC I can still remember the first time I was watching e3 coverage and couldn't tell half the games apart. those were simpler times. (3 days ago)

@konjak do you always exist in such dramatic lighting (3 days ago)

@floatvoid @DanFessler I just clicked on "namco" and "final lap" totally at random to check it out. realized I played this one ALL THE TIME. (4 days ago)

RT @emotionalpedant: rt if u agree t.co/vEyxltGY4i (4 days ago)

RT @Draknek: Less than 24hrs to get A Good Bundle if you haven't already: t.co/yeZA1GGEqA - $20 donation to ACLU/Planned Parenthood… (5 days ago)

@konjak the ultimate attack (5 days ago)

@Digiflower5 If you're trying game capture, maybe window capture instead? Switch to the beta branch on steam, controller might work then. (5 days ago)

@endshark AAUGIHGIHgi42=082w4h (5 days ago)

@endshark 1991 (when the calendar loops back around) (5 days ago)

gameboy doodle or somethin' i dunno t.co/7yJz0Nawcd (5 days ago)

@Iateyourp1e holy. moly. (5 days ago)


2013 - 4 - 8 / 12:21 pm / tutorials

FlashDevelop with HaXe NME and HaXePunk

FlashDevelop with HaXe NME and HaXePunk

I spent most of yesterday diving into a whole new world of magic and fun: Haxe. I was hesitant at first because I was dreading the whole ordeal of setting up a new development environment, but it turned out to be way more straight forward than most set ups I've experienced.

I ended up getting a quick demo of thousands of entities rotating, scaling, and alpha blending at a steady 50-60fps with the Windows build of HaxePunk, and that has me pretty excited!


Follow along as I take you on a journey of code and game development! (For reference, I'm using Windows 7.)

Before You Start
I'm assuming that you are a flash developer that's using FlashDevelop and you want to migrate to Haxe NME. More specifically, this will be about getting HaxePunk up and running as quickly and as easily as possible. Oh, and I'm also assuming you're using Windows.

Download NME Installer
Go on over to the NME downloads page and download the installer for your OS. For Windows, you want to download this installer.

The NME installer will take care of a lot of stuff for you, and actually we're already almost done after installing just this.

Command Line Setup
After the installer is finished running you'll have to do one more thing to actually finish the set up completely. Open up a command prompt window (if you go to the start menu and just type 'cmd' you'll find it) and type 'nme setup windows' into it.


You'll be presented with a prompt to install Visual Studio C++ Express. Go ahead and do that, as this is necessary for FlashDevelop to build your project to a native windows application.

FlashDevelop Template
Now that NME is installed and the Windows stuff is set up, you'll want to install some FlashDevelop project templates. This enables you to start a new NME project in FlashDevelop when you launch it.

New NME Project
This is where things get a little weird since we're not following the typical HaxePunk install route. We're going to start a new NME project, and then dump HaxePunk into the source folder of that project to use it. There are other ways to do it, but after struggling with some stuff yesterday, this is the best way I could get working for now.


Start a new project in FlashDevelop and choose an NME Project. Click OK to create the project. It generates some default files and folders for you, and we're going to mess with those a little bit now.

HaxePunk Setup
Almost done! Now go download the latest version of HaxePunk from the Git page. Just click on the "ZIP" button to download a zip file of the entire repository. Inside that zip file that you just downloaded there is a "src" folder. Inside that folder is a "com" folder. Take the "com" folder and add it to the "src" folder of the NME project we just created.

You also need to take the contents of the "assets" folder in the HaxePunk zip file and place them in the "assets" folder of your new project.

Hooking up Assets
There's one more important thing that you'll need to change, and that's the "application.nmml" file. For those of you that have worked in AIR, this is somewhat similar to the application.xml file for AIR projects. In the assets section (line 19) you'll need to add some lines for the HaxePunk assets we just added.

I used this file as a guide to figure out what to modify in here. My assets section of my application.nmml ends up looking like this.

A New Main.hx
The final thing that needs to be changed is the Main.hx file in the project. Since HaxePunk works differently than the native Flash style code, we'll need a new Main.hx. Here's the complete code for Main.hx that I based off of this file.

package ;

import com.haxepunk.Engine;
import com.haxepunk.HXP;

class Main extends Engine {
public function new() {
super(640, 480, 60, true);
override public function init():Dynamic {
trace("HaxePunk is running!");
public static function main() { new Main(); }

Now with any luck you should be able to build this project into anything you want! Flash, Windows, HTML5, and more. I haven't done much with Android or iOS building yet, so I'm not really sure what's involved for those... but this should be enough to get you started with HaxePunk with NME.

Pro Tips
There's an option in FlashDevelop that makes autocomplete kinda clunky with Haxe for some reason. To fix this issue, go to Tools -> Project Settings. Go to the "HaxeContext" section, and set "Disable Completion on Demand" to False.


If you have issues compiling to a Windows build, try setting up Visual Studio again with the command line "nme setup windows"

Check out this handy list of AS3 -> HaXe conversions.

Make sure you're using the nme library when importing classes. For example, you want to use "nme.geom.Point" for the Point class and NOT "browser.geom.Point" or any other. FlashDevelop will autocomplete for you alphabetically, so just double check that you're getting the nme versions of things when importing.

Downloads Recap
Download the latest HaxePunk zip.

Download the NME 3.5.5 Windows installer.

Download the verison 4.3.0 of FlashDevelop.

Download the FlashDevelop project templates for HaXe NME.


2013 - 4 - 8 2:00 PM


and a tutorial how can we conver a FlashPunk project for Haxepunk? :3


2013 - 4 - 11 12:47 PM


I guess the struggles you experienced are related to my own? See here: http://forum.haxepunk.com/index.php?topic=342.0


2013 - 4 - 12 1:39 AM


Actually strangely enough I didn't encounter that specific problem. I actually just wanted direct access to the HaxePunk source inside my project rather than having it live in the Haxelib folder in a faraway place.

I'm actually putting Haxepunk down for now because it has a lot of shortcomings that I didn't notice when I first started experimenting with it. It's a bummer because I'm really excited about the prospect of better performing games on Win/Mac/Linux, but it's just not polished enough for a big game project.


2013 - 4 - 29 3:35 PM


Are these shortcomings related to HaxePunk's base in FlashPunk or are they issues with HaxePunk itself?

Care to elaborate a bit more on this?


2013 - 5 - 3 3:45 PM


The short comings are with HaxePunk itself. I love FlashPunk and if I could use it forever, I would. HaxePunk is missing some of the core functionality of drawing (right now at least) that I use a lot in FlashPunk. Stuff like drawing lines, circles, rectangles, manipulating bitmapdata and using it for image rendering, and certain image features like sprite.flipped are broken or not yet implemented for native targets. I believe it's also not ported with the latest version of FlashPunk in mind (which is maintained by Draknek and not Chevy Ray anymore)

If there was a complete copy of FlashPunk as it stands right now with way better performance and compilation to native targets then I would be all over it. HaxePunk is close, but it's not there yet for my needs unfortunately.


2013 - 9 - 30 9:05 AM


Hi Kyle,

I've been researching the avaiable options in Haxe and, as you pointed out, it seems that they lack some maturity. The one ahead is HaxeFlixel in community activity, commits and docs. It can be a good start.
Out of curiosity... are you still using Haxe? If you do, what are you going for? Creating your own framework?



2013 - 9 - 30 3:35 PM


Hey! I am not working in Haxe anymore. I called it quits on Haxe after I realized that a lot of basic functionality that I was used to was not present yet in HaxePunk. I did look into HaxeFlixel a little bit, but after some more experimentation I landed on C# and SFML which I'm currently using to build a framework.


2014 - 2 - 9 3:31 PM


Are you able to provide the source code for the test app in the post? The one with a lot of rectangles


2014 - 2 - 10 12:02 AM


Unfortunately it's been a long time since I've used Haxe, and I don't have the source for that test application anymore.


2014 - 2 - 10 8:16 AM


Can you remember how you drew the squares and rotated them? Was it an HaxePunk API or AS3 directly?


2014 - 2 - 10 12:00 PM


I'm pretty sure I just made a square graphic and used HaxePunk to create thousands of them. When they were created they would get a random color and alpha and scale, and during their update they would rotate.


Post your comment!




Hi! My name's Kyle, and I make video games most of the time in Denver, Colorado. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. I also created and maintain Otter, a 2d game making framework. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by! You're the coolest.

blog stuff






Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!


Your message has been sent! Thanks :)