{"id":1008,"date":"2013-01-27T13:09:43","date_gmt":"2013-01-27T18:09:43","guid":{"rendered":"http:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/?p=1008"},"modified":"2015-10-24T02:17:55","modified_gmt":"2015-10-24T06:17:55","slug":"sponsorship-of-flash-games-in-haxe","status":"publish","type":"post","link":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/2013\/01\/sponsorship-of-flash-games-in-haxe\/","title":{"rendered":"Sponsorship of Flash Games in Haxe"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1009\" alt=\"haxe\" src=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-content\/uploads\/2013\/01\/haxe.jpg\" width=\"135\" height=\"135\" \/>Recently <a href=\"http:\/\/magneticatgames.com\/\">magneticat<\/a> asked on <a href=\"https:\/\/www.fgl.com\/\">FGL<\/a> about getting sponsorships for Flash games developed in <a href=\"http:\/\/haxe.org\/\">Haxe<\/a>. Having just gone through the process of publishing <em><a href=\"http:\/\/rocketshipgames.com\/games\/goldleader\/\">Gold Leader<\/a><\/em> I&#8217;d been thinking about and dealing with those specifics quite a bit. \u00a0These are some of my thoughts (adapted from the thread).<\/p>\n<p>The basic question is whether or not there&#8217;s any obstacle toward getting sponsorships when developing in Haxe. \u00a0From the sponsor&#8217;s perspective I can&#8217;t see that it would matter, provided you can integrate with their API(s) and branding. \u00a0It&#8217;s a game, it runs in Flash, users won&#8217;t know any difference, so why would the sponsor care? \u00a0Certainly Haxe probably lends itself toward some types of games and not others, but that&#8217;s no different from developing in Flex\/raw AS3 rather than the Flash UI. \u00a0The latter lends itself more to very graphical, simple games that you can construct on the timeline. \u00a0The former lends itself to more programmatic, performance oriented games with a lot of reusable elements (sprites, tiles, etc.). \u00a0Haxe is no different, just higher performing and more pleasant to develop in.<\/p>\n<p>From the developer&#8217;s perspective then it&#8217;s all about how possible or easy it is to incorporate sponsors&#8217; APIs and branding assets.<\/p>\n<h2>Access to Adobe Flash<\/h2>\n<p>At the highest level, that question divides into two camps based on whether or not you have access to and\/or choose to use Adobe Flash. \u00a0If you want to use Haxe but also have access to and are willing to use the Adobe UI, then you&#8217;re pretty much good to go. \u00a0You should be able to develop the game and then bring it in as an SWF or such if you really need to incorporate some elements using the actual Flash UI.<\/p>\n<p>If you don&#8217;t have or aren&#8217;t willing to use Adobe Flash, the biggest concerns seem to be how rich the sponsor&#8217;s splash screen is, how they&#8217;re willing to provide it, and whether or not they have their own preloader they want you to use. \u00a0Basically, if you&#8217;re going to have to work with a .fla and you don&#8217;t have Adobe Flash, there&#8217;s essentially no workaround and you&#8217;re stuck.<\/p>\n<p>Otherwise you can probably figure something out and\/or integrate it all together at the end in Flash. \u00a0You could probably do this without paying, or at least not paying much, by using either the trial version or Adobe&#8217;s new cloud service to effectively rent it for just a month or whatever you need. \u00a0If you&#8217;re on Linux you should be able to do all of this in a Windows VM. Success under WINE or similar seems pretty iffy.<\/p>\n<h2>Integration Details<\/h2>\n<p>The real question then is how much you can do without access to or using Flash.<\/p>\n<p>Integrating with AS3 code libraries is actually generally really straightforward. \u00a0Haxe&#8217;s whole approach to Flash makes this capability integral to the system, and there are many blog posts and other docs on it. \u00a0If the library is precompiled you can just link it in. If it&#8217;s AS3 source, you can use Adobe&#8217;s free Flex SDK tools to compile it for linking from Haxe.<\/p>\n<p>There are a couple other gotchas, like a\u00a0<a href=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/2013\/01\/opening-links-in-flash\/\">different default network security model<\/a>, but they&#8217;re all easily fixed once you realize that&#8217;s what&#8217;s going on.<\/p>\n<p>If the splash screen is just a movie the sponsor can provide as an SWF then you&#8217;re probably good to go. \u00a0NME has increasing <a href=\"http:\/\/www.joshuagranick.com\/blog\/2012\/01\/24\/embedding-swfs-makes-nme-meme-friendly\/\">cross-platform support for SWFs<\/a>\u00a0(read the comments for updates), though it doesn&#8217;t currently seem to support sound. \u00a0Fortunately, you can instead\u00a0<a href=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/2013\/01\/play-external-swf-movieclip-from-haxenme\/\">use the Flash API to play the SWF directly<\/a>.\u00a0 However, if the splash screen is some complex thing with buttons and different events that requires you work with the .fla, then you&#8217;re in big trouble if you don&#8217;t have access to the Flash tools. \u00a0Basically nothing else, even the Flex tools, will work with .fla files so you&#8217;ll realistically probably need to have access to and use Flash to hook it all up.<\/p>\n<p>If the sponsor is providing their own preloader as code, you should be able to work with it somewhat like any other AS3 library, though it&#8217;s much trickier. \u00a0I wrote some AS3 preloaders for Haxe games a while back before NME&#8217;s preloader support was greatly improved, so it&#8217;s doable. \u00a0It does require a fair bit of understanding of the Flash boot process though and isn&#8217;t for the faint of heart. \u00a0It might be a lot easier now though that NME&#8217;s preloader hooks have been cleaned up. \u00a0Writing your own preloader in Haxe is really simple in the latest versions of NME.<\/p>\n<h2>My Experience<\/h2>\n<p>I personally use Linux and do not want to install a Windows VM, so I&#8217;m working without the Flash tools. \u00a0That could definitely be constraining. \u00a0Looking at some portals&#8217; branding, you would need Flash to work with their .fla files. \u00a0Part of why I jumped on <a href=\"http:\/\/gameshed.com\">GameShed&#8217;s<\/a> offer for <a href=\"http:\/\/rocketshipgames.com\/games\/goldleader\/\"><em>Gold Leader<\/em><\/a> was because the integration sounded straightforward (they turned out great in every way as well).<\/p>\n<p>The final published\u00a0<em><a href=\"http:\/\/www.gameshed.com\/Retro-Games\/Gold-Leader\/\">Gold Leader<\/a><\/em>\u00a0is all in Haxe and other than whatever the artist and musician used, it was developed entirely on Linux using only free tools. \u00a0In terms of integration, it incorporates an <a href=\"http:\/\/code.google.com\/p\/gaforflash\/\">AS3 library from Adobe for Google Analytics<\/a> (my internal tracking and play instrumentation), Mochi&#8217;s AS3 libraries (MochiScore leaderboard), GameShed&#8217;s AS3 API (site achievements), and their SWF splash screen. \u00a0It definitely took some time to figure a couple of these out, but the actual code is easy so doing similar in the future will be a breeze. \u00a0GameShed provided its API as AS3 source. \u00a0Interestingly,\u00a0it was essentially trivial to make a couple syntactic edits (to package, float, and for loop declarations) and compile it directly in Haxe. \u00a0That was quicker and easier to do than to compile with Flex and link against, though that also would not have been a big challenge.<\/p>\n<p><a href=\"http:\/\/rocketshipgames.com\/tools\/rockethaxe\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1012\" alt=\"rockethaxe-100x100\" src=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-content\/uploads\/2013\/01\/rockethaxe-100x100.png\" width=\"100\" height=\"100\" \/><\/a>All of the non-game-specific code from <a href=\"http:\/\/rocketshipgames.com\/games\/goldleader\"><em>Gold Leader<\/em><\/a> is open sourced and available in\u00a0<a href=\"http:\/\/rocketshipgames.com\/tools\/rockethaxe\/\">RocketHaxe<\/a>. \u00a0The library is\u00a0not super comprehensive yet, but what it does is useful and seems fairly high performance. \u00a0It also includes code showing how to incorporate Google Analytics, Flash native cursor support, and a few other platform features. \u00a0As I clean up and generalize some of the last-minute code from\u00a0<a href=\"http:\/\/www.gameshed.com\/Retro-Games\/Gold-Leader\/\"><em>Gold Leader<\/em><\/a>&#8216;s final push I&#8217;ll be adding SWF player helpers, the Mochi API library, and some other bits.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently magneticat asked on FGL about getting sponsorships for Flash games developed in Haxe. Having just gone through the process of publishing Gold Leader I&#8217;d been thinking about and dealing with those specifics quite a bit. \u00a0These are some of my thoughts (adapted from the thread). The basic question is whether or not there&#8217;s any &hellip; <a href=\"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/2013\/01\/sponsorship-of-flash-games-in-haxe\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[279,69,82,277],"class_list":["post-1008","post","type-post","status-publish","format-standard","hentry","category-code","tag-business","tag-flash","tag-haxe","tag-videogames"],"_links":{"self":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts\/1008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/comments?post=1008"}],"version-history":[{"count":2,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts\/1008\/revisions"}],"predecessor-version":[{"id":1014,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/posts\/1008\/revisions\/1014"}],"wp:attachment":[{"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/media?parent=1008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/categories?post=1008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocketshipgames.com\/blogs\/tjkopena\/wp-json\/wp\/v2\/tags?post=1008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}