Tag: Haxe NME
Thanks, as seems increasingly usual, to Joshua Granick for writing about another awesome Haxe feature that works so well with NME: Inline C++!
This seems so obvious! It compiles to C so why can’t we throw our own stuff in there? Obviously you sacrifice the niceties of a higher level language like Haxe: Vague compiler errors and manual memory management abound, but it’s worth it sometimes.
For example: My first thought, since I’ve been implementing around it for some time, was to try and implement game saves on my HP TouchPad. I actually tried to use NME’s extension system to implement this a few weeks ago and got nowhere, so I wasn’t sure what to expect. I wanted to call into the webOS API to get a safe path using PDL_GetDataFilePath(), then write a string out to a file, and in a second function be able to read that string back.
I’ve been implementing a second thread of execution in my current game project for the last few days. I had already tried and mostly failed to do this in a previous project.
At that time there was almost no instruction online as to how threads worked in NME, but that has changed recently thanks to the (always excellent) Joshua Granick, whose blog post, “Using Threads with NME“, lists out some basic scenarios for communication between threads. There’s also some useful nuggets of information in this forum thread.
In my new “Tower Defence” project I need to know when certain things are touching, or when object A is within range of object B, and other nonsenses like that.
In the early days of this project I implemented a collision system again with just two shape types: Rectangle and circle. It worked well enough, but the performance was awful. I had knocked together a few arrays and an update loop, but more advanced stuff like knowing which objects could be safely ignored to speed the whole process up takes time to write and test. Having experience with it previously, I dropped Box2D in to my project so I could begin prodding.
Pong was a short project attempting to clean up my code base for Pinball, as well as rectify several nasty and hard-to-catch bugs who were only really present because Pinball was based directly on the first Haxe code I’d written which as you can guess, wasn’t totally solid. Eventually the need to rewrite a lot of my core code is what made me cease development on Pinball, although Pong did help resolve several issues. It was also built while Atari was running it’s Pong Indie Developer Challenge, so I wanted to experiment with some alternate game modes, hence the strange selection of gametypes on offer (multiball is still my favourite).
Continue reading “Pong project”
Pinball was my first real project with NME, and influenced everything I’m doing with it now. It was very much an experimental project to gain understanding of how it all worked, and in retrospect, I wrote a lot of very heavy, slow code that was unnecessary.

Continue reading “Pinball”