tag:blogger.com,1999:blog-5052387.post7047725880709176096..comments2024-03-17T16:13:55.262-07:00Comments on Blobs in Games: Switching to HaxeAmithttp://www.blogger.com/profile/12159325271882018300noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-5052387.post-22651434538327151322012-04-20T07:48:15.387-07:002012-04-20T07:48:15.387-07:00This comment has been removed by the author.Christopher Lightfoothttps://www.blogger.com/profile/11553264212817527110noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-8291365716412507052012-04-20T01:26:58.539-07:002012-04-20T01:26:58.539-07:00The problem I had was a 2D Map template that you i...The problem I had was a 2D Map template that you initialised with a tile class; I wanted the map to be able to create instances of the tiles and assign them to the map array but HaXe wouldn't let me create instances of the tile type as it didn't know how to call the constructor of the tile class.<br /><br />The constrains on the template seem to only work for initialising an instance of the template itself; they don't seem to aid the compiler (as I'd assume they would) in determine what methods are available on the class they're templating (i.e. the tile class).<br /><br />The workaround was to provide an overridable method on the map class that created "instances" of tiles; and then subclass the template with a map class for each tile type; so for example:<br /><br />class TileMap extends Map<Tile> {<br /> private function createInstance() : Tile {<br /> ...;<br /> }<br />}<br /><br />Also love Mixins too; very useful :-D. Not tried macros yet either but they look fun; maybe I could write a better template system using macros...Christopher Lightfoothttps://www.blogger.com/profile/11553264212817527110noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-91765665212321609802012-04-20T01:26:07.567-07:002012-04-20T01:26:07.567-07:00This comment has been removed by the author.Christopher Lightfoothttps://www.blogger.com/profile/11553264212817527110noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-70811479032013088382012-04-19T15:04:06.512-07:002012-04-19T15:04:06.512-07:00lightfoot256: Getting used to Haxe after AS3 didn&...lightfoot256: Getting used to Haxe after AS3 didn't take long for me (although I have yet to try macros or generics) but every once in a while I run into a situation where the more general for loop would be nicer. :)<br /><br />I'm not quite sure what you mean by the limitations of class template parameters, as I haven't used them yet. Have you tried using constraints on those parameters to tell the compiler what they'll include? If you don't include the parameters the compiler has to assume there's nothing you can rely on.<br /><br />NME looks promising. Right now I'm writing Stage3D so I haven't done much with NME, but I'll take a look at it for a future project.<br /><br />Steven: Yes, it does seem nice for casual/browser/mobile games. I haven't tried the Java or C# backends. I don't have much use for those languages at the moment. I thought they were dead too, as the tweet announcing them was two years ago, but they seem to be alive again.<br /><br />I didn't know about NekoML. Interesting. I don't have any use for Neko at the moment but I'll keep it in mind.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-78607941215638911582012-04-16T19:04:01.255-07:002012-04-16T19:04:01.255-07:00Nice to see you adopting haXe. I've been watch...Nice to see you adopting haXe. I've been watching it for a while myself. It seems well-suited to browser-based games development in particular. Not much else compiles to Flash.<br /><br />Have you tried the Java (or C#) backends? I thought they were dead but it seems they are recently alpha and in the haXe mainline.<br /><br />I had hopes that NekoML would gain popularity but the non-C style syntax must be a barrier to some.<br /><br />http://nekovm.org/doc/nekomlAnonymoushttps://www.blogger.com/profile/06340403723350864929noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-11995393050066612682012-04-16T01:35:11.723-07:002012-04-16T01:35:11.723-07:00Another convert! Hurah! I'd been throwing Adob...Another convert! Hurah! I'd been throwing Adobe a rope for a long time waiting for AS3 and the Flash platform (or rather their compiler/framework) to just be able to output native binaries for whatever platform and year after year they constantly failed to deliver. I'd been watching HaXe for a while but waiting for that point I could safely switch without too much of a headache.<br /><br />Anyway; I eventually did it about a month ago; I love the workflow for creating iOS games and the ability to press a different button and get the native mac version, or the native windows version, or a html5 version! It's perfect. It's still a little rough around the edges but from the progress and support and the community around it (it's all open source - so if you find a bug, you can fix it, report it and it gets fixed! I've already fixed a bug, raised it and it was fixed within the day!) I can see it only getting better and better with time.<br /><br />The biggest initial hurdle for me were the initial language changes and variants over as3; However it didn't take long to realise they're actually more useful than their counterparts; 'for' loops were initially irritating but now I can't see why we've been doing it the old way for so long :-D.<br /><br />My biggest gripe however so far is the Class template system; In other languages I'd expect the template to be almost a huge macro allowing you to call functions on the "type" you're templating or even create objects of that type within it (example; a map template that initialises it's own map) however HaXe has a big whinge and moan about the type not being specified or available; There are work arounds but I guess at least HaXe has templates :-D.<br /><br />Overall impressed with HaXe and NME; can't wait to see how it develops.<br /><br />ChrisChristopher Lightfoothttps://www.blogger.com/profile/11553264212817527110noreply@blogger.com