October 2015 Posts

Unity Ash – A different way of thinking about making games in Unity

Unity Ash – A different way of thinking about making games in Unity

Over a year ago I decided to scratch an itch and see if I could get Richard Lord’s Ash framework to work in Unity. It actually turned out to be far easier than I had imagined. A few people contacted me as they wanted to use it for production games so I decided to do a little more work on it a few months later to fix some of the easily solved issues with my quick port.

Unfortunately I lacked any spare time to work on it until now. This week I spent 3 days rewriting the framework from scratch. I improved many things, making it much more Unity-friendly, and generally easier to use. Because of the differences from the AS3 version of Ash I now describe it as “heavily inspired” rather than a port.

Mr Nibbles Forever – Out Now on Amazon

Mr Nibbles Forever – Out Now on Amazon

Just a quick one to let you know that Mr Nibbles Forever is now available to download on your Amazon device!

This was a bit of a longshot as there aren’t too many Amazon devices out there but it was a low-hanging fruit as there wasnt too much needed to make the Android build work, just a new IAP system and thats about it.

Im thinking about doing a web version of the game too, what do you think?

Making AS3 Promises and Mockolate Play Nice

Making AS3 Promises and Mockolate Play Nice

For the past 5 months my day job has been an AS3 developer with the awesome folks over at The Broth in Perth. Having worked with AS3 for most of my professional career it was a good fit for my coding skills.

I hadn’t worked in AS3 for about 2 years before joining but there wasn’t much to catch up on regarding the language or platform (sadly things arent moving very fast in the Flash world these days) but there was much to catch up with regards to my new interest in Unit Testing and TDD. I made it my mission to become the testing, clean code and best practices guy here and as such have been learning and writing many tests.

As anyone that has done unit testing will know, mocking is a big part of unit testing. In AS3 one of the main mocking libraries is called Mockolate. Its an excellent library but unfortunately it hasnt been updated for over 3 years, so when I ran into an issue with it in conjunction with another AS3 library promise-as3 (not updated for 1+ years) it lead to weeks of frustration.

The issue, as documented on their issue tracker here, is that when you try to use a Promise as return of a function call then it results in strange errors:

D:\libs\adobe\flex\sdk\4.6\bin\adl.exe -profile extendedDesktop D:\testApp\out\test\desktop\_flexunit-descriptor.xml D:\testApp\out\test\desktop
Player connected; session starting.
[Fault] exception, information=VerifyError: Error #1053: Illegal override of TestInterface600C55060B003CF6CD88EB5CFE69DFE741318F03 in mockolate.generated.TestInterface600C55060B003CF6CD88EB5CFE69DFE741318F03

The same goes for if you try to use Promises in interfaces.

Well after many hours of trail and error I found the problem. It looks as if there was a circular dependency within the Promises library so within the constructor of the Promise and Resolver classes depended upon each other. This meant that Mockolates subsystem (Floxy) couldnt generate proxy classes for them and thus they couldnt be mocked.

I fixed the issue, forked and committed:

https://github.com/mikecann/promise-as3

I also submitted a pull request here:

https://github.com/CodeCatalyst/promise-as3/pull/49

But I don’t have much hope that it will ever get accepted due to the dead nature of the library (and the ecosystem as a whole) but I hope it helps any other lost AS3 sheep in the future!