<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
	xml:lang="en">
	<title>Mindless Labs dev blog</title>
	<subtitle>Dev News and Stuff</subtitle>
        <link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/index.php"/>
        <link rel="self" type="application/atom+xml" href="http://www.mindless-labs.com/blog/atom.xml"/>
	<updated>2011-01-13T08:30:40-00:00</updated>
	<author>
	<name>blogmaster</name>
	<uri>http://www.mindless-labs.com/blog/index.php</uri>
	<email>palotai.robin@gmail.com</email>
	</author>
	<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog</id>
	<generator uri="http://www.pivotlog.net" version="Pivot - 1.40.7: 'Dreadwind'">Pivot</generator>
	<rights>Copyright (c) 2011, Authors of Mindless Labs dev blog</rights>
	
	
	
	<entry>
		<title>Game design document</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/11/24/Game_design_document" />
		<updated>2009-11-24T13:31:00-00:00</updated>
		<published>2009-11-24T13:29:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.51</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">If you are about to create a new game, be sure to read this nice article along with its predecessors.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/11/24/Game_design_document"><![CDATA[
                If you are about to create a new game, be sure to read <a rel="external" href="http://bbrathwaite.wordpress.com/2008/11/30/creating-a-game-design-document/">this nice article along with its predecessors</a>.
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Pixel art and the curse of reality in flash games</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/11/21/Pixel_art_and_the_curse_of_reality_in_flash_games" />
		<updated>2009-11-21T22:26:00-00:00</updated>
		<published>2009-11-21T22:07:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.50</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Lately I'm working on a small and easy game in my spare time, which has pixel art style graphics. Usually I favor vector graphics with nice gradients, bells and whistles, but now I have chosen pixels for a time-limit reason. Not that producing quality pixel art would take less time than producing quality art of different styles, however the trick lies in user perception and the so-called curse of reality...</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/11/21/Pixel_art_and_the_curse_of_reality_in_flash_games"><![CDATA[
                <p>Lately I'm working on a small and easy game in my spare time, which has pixel art style graphics. Usually I favor vector graphics with nice gradients, bells and whistles, but now I have chosen pixels for a time-limit reason. Not that producing quality pixel art would take less time than producing quality art of different styles, however the trick lies in user perception and the so-called curse of reality...</p><h3>Curse of reality and game graphics</h3>
<p>The expression <i>curse of reality</i> is applied in the movie world in connection with animated movies and refers to the observation that the closer an animation is to reality, the more sensitive are the watchers to small production errors. This is quite understandable, since we live in the reality, and once someone approaches our domain we are sure to spot the glitches. At the opposite end, if graphics is far from reality, why should we care if it fails to resemble it?</p>
<p>The same principle can be applied to game graphics - when producing pixel art, you are not producing "cheaper" art or "easier" art, but an art of a different style which is less related to reality than others. Therefore your players rely less on their senses but more on their imagination to build up their inner image of the game - and moving the imagination of players is a powerful consequence! Remember the games on the ZX Spectrum? Some of the actors in the games were mere blobs of pixels but the player felt excited nevertheless.</p>
<h3>Don't break consistency</h3>
<p>While I'm not great at graphics, my general goal is to produce consistent artwork where the parts fit together. I prefer a less detailed but self-consistent style than a style with more detail at some parts but less at others, because the latter inconsistency alerts the player that something fishy is going on and interferes with expanding his or her free imagination.</p>
<p>This is the beginning of my journey to the pixel art world, and I'm curious to explore the hidden treasures.</p>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>VelociRapid game element preview</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/11/19/VelociRapid_game_element_preview" />
		<updated>2009-11-21T21:36:00-00:00</updated>
		<published>2009-11-19T23:18:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.49</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Click the banner to play a preview of prey fleeing, and also take a peek underneath to see the quadtree space partitioning (nodes do not collapse right now). WSAD to control the dino.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/11/19/VelociRapid_game_element_preview"><![CDATA[
                <p>Click the banner to play a preview of prey fleeing, and also take a peek underneath to see the quadtree space partitioning (nodes do not collapse right now). WSAD to control the dino. </p><p><center><a rel="external" href="http://mindless-labs.com/raptor.html"><img width="182" src="http://mindless-labs.com/files/velocirapid_prev1.gif"/></a></center></p>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Velocirapid sketch</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/11/12/Velocirapid_sketch" />
		<updated>2009-11-12T13:51:00-00:00</updated>
		<published>2009-11-12T13:47:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.48</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Velocirapid, our possible candidate for the 60sec flash game contest. Click the image to see full size.
GraphicsGale is indeed a very handy software for editing pixel art.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/11/12/Velocirapid_sketch"><![CDATA[
                Velocirapid, our possible candidate for the 60sec flash game contest. Click the image to see full size.
GraphicsGale is indeed a very handy software for editing pixel art.
<p>
<a rel="external" href="http://mindless-labs.com/files/velocirapid_sketch.gif"><center><img src="http://mindless-labs.com/files/velocirapid_sketch_small.gif" /></center></a></p>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Gambit's response to recent virtual currency changes</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/11/05/Gambits_response_to_recent_virtual_currency_changes" />
		<updated>2009-11-05T10:19:00-00:00</updated>
		<published>2009-11-05T10:19:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.47</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">An interesting read at the Gambit blog.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/11/05/Gambits_response_to_recent_virtual_currency_changes"><![CDATA[
                An interesting read at the <a rel="external" href="http://blog.getgambit.com/facebook-changes-scamville-fact-vs-fiction-in-the-offers-debate/">Gambit blog</a>.
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Dirty coding tricks of game developers</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/11/03/Dirty_coding_tricks_of_game_developers" />
		<updated>2009-11-03T10:02:00-00:00</updated>
		<published>2009-11-03T10:02:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.46</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Read it at Gamasutra</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/11/03/Dirty_coding_tricks_of_game_developers"><![CDATA[
                Read it at <a rel="external" href="http://www.gamasutra.com/view/feature/4111/dirty_coding_tricks.php">Gamasutra</a>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>JsUnHaXe - Javascript cleanup for Haxe</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/10/27/JsUnHaXe_-_Javascript_cleanup_for_Haxe" />
		<updated>2009-10-27T16:42:00-00:00</updated>
		<published>2009-10-27T16:42:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.45</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">When developing flash games, you often need different architectural components: the game in flash, a server for save states and high scores, and maybe javascript for integrated flash-and-html user experience like status messages on the web page reflecting in-game events.
Haxe is a swiss toolkit language: write all your code in haxe and then compile to different platforms like neko or php (for the server), flash or javascript. Now I will consider the javascript target.

Haxe and multi-file javascript

When compiling to javascript, you often would like to separate functionality into a common core and smaller modules. However when compiling with Haxe, it will generate all the core data into the sub-modules too (well, this is not a precise description of what is happening, but let's stick with it for now). Having a MyCore class and a MyCoreExtension1 class, after compiling with haxe -js my_core.js MyCore and haxe -js my_core_ext1.js MyCoreExtension1, both generated js files will contain definitions for MyCore.

Fortunately it doesn't seem to be hard to decouple the modules from the core. I wrote a small python script that I call JsUnHaXe, which removes redundant entries from generated js files. Download and try it using python jsunhaxe.py out_dir my_core.js my_core_ext1.js. Note that sub-modules, sub-sub-modules, etc. can be passed, in this case the Kth output file will lack all entries beginning from the first and up to the K-1th input file.

Happy Haxing!</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/10/27/JsUnHaXe_-_Javascript_cleanup_for_Haxe"><![CDATA[
                <p>When developing flash games, you often need different architectural components: the game in flash, a server for save states and high scores, and maybe javascript for integrated flash-and-html user experience like status messages on the web page reflecting in-game events.</p>
<p>Haxe is a swiss toolkit language: write all your code in haxe and then compile to different platforms like neko or php (for the server), flash or javascript. Now I will consider the javascript target.</p>

<h4>Haxe and multi-file javascript</h4>

<p>When compiling to javascript, you often would like to separate functionality into a common core and smaller modules. However when compiling with Haxe, it will generate all the core data into the sub-modules too (well, this is not a precise description of what is happening, but let's stick with it for now).</p> Having a <tt>MyCore</tt> class and a <tt>MyCoreExtension1</tt> class, after compiling with <tt>haxe -js my_core.js MyCore</tt> and <tt>haxe -js my_core_ext1.js MyCoreExtension1</tt>, both generated js files will contain definitions for MyCore.</p>

<p>Fortunately it doesn't seem to be hard to decouple the modules from the core. I wrote a small <a rel="external" href="http://www.mindless-labs.com/files/jsunhaxe.py" title="">python script that I call JsUnHaXe</a>, which removes redundant entries from generated js files. Download and try it using <tt>python jsunhaxe.py out_dir my_core.js my_core_ext1.js</tt>. Note that sub-modules, sub-sub-modules, etc. can be passed, in this case the Kth output file will lack all entries beginning from the first and up to the K-1th input file.</p>

<p>Happy Haxing!</p>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Haxe serializer speed</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/10/17/Haxe_serializer_speed" />
		<updated>2009-10-17T23:13:00-00:00</updated>
		<published>2009-10-17T23:13:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.44</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">The serializing feature of Haxe can be very handy - for example using Haxe Remoting in a flash game to communicate with your server, Haxe objects are automatically serialized on the client (converted to textual form), sent over to the server, and unserialized to object form. However the speed of serializing does matter.

The serializer not only serializes the object passed to it, but also automatically follows and serializes references to other objects. As an example, if you pass the root element of a tree structure for serialization, it will follow the links to the child nodes and as a result serialize the whole tree. This is very fine, but if the objects contain cyclic references - like child nodes linking back to their parents - the serializer would run into an endless loop.

For avoiding this, the serializer has an option called useCache, which when turned on, the serializer keeps a memory of previously met objects and won't re-serialize them. Unfortunately, for technical reasons the lookup of an object in this memory takes O(n) time, n being the number of objects met while serializing, so the full serializing takes O(n^2) time.

This means that if you are keen on speed, you must not use the useCache option, and take care of serializing structures without cyclic references. And, unconvenient as it is, but sometimes you may have to consider going down to the level of (un)serializing by hand, which would enable for highly tuned speed.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/10/17/Haxe_serializer_speed"><![CDATA[
                <p>The serializing feature of Haxe can be very handy - for example using Haxe Remoting in a flash game to communicate with your server, Haxe objects are automatically serialized on the client (converted to textual form), sent over to the server, and unserialized to object form. However the speed of serializing does matter.

<p>The serializer not only serializes the object passed to it, but also automatically follows and serializes references to other objects. As an example, if you pass the root element of a tree structure for serialization, it will follow the links to the child nodes and as a result serialize the whole tree. This is very fine, but if the objects contain cyclic references - like child nodes linking back to their parents - the serializer would run into an endless loop.

<p>For avoiding this, the serializer has an option called <i>useCache</i>, which when turned on, the serializer keeps a memory of previously met objects and won't re-serialize them. Unfortunately, for technical reasons the lookup of an object in this memory takes O(n) time, n being the number of objects met while serializing, so the full serializing takes O(n^2) time.

<p>This means that if you are keen on speed, you must not use the <i>useCache</i> option, and take care of serializing structures without cyclic references. And, unconvenient as it is, but sometimes you may have to consider going down to the level of (un)serializing by hand, which would enable for highly tuned speed.
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Preloading example with Haxe and SamHaxe</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/09/20/Preloading_example_with_Haxe_and_SamHaxe" />
		<updated>2009-09-20T10:12:00-00:00</updated>
		<published>2009-09-20T10:12:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.43</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Let's see how can we create a preloaded swf for our flash game, widget or website using pure Haxe. For embedding the assets, we will use SamHaxe, our new flash asset tool.

Our goal is to have heavy assets in our swf, but would like to show a progress bar until all these assets have loaded.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/09/20/Preloading_example_with_Haxe_and_SamHaxe"><![CDATA[
                <p>Let's see how can we create a preloaded swf for our flash game, widget or website using pure Haxe. For embedding the assets, we will use <a rel="external" href="http://mindless-labs.com/trac/samhaxe">SamHaxe</a>, our new flash asset tool.
</p><p>
Our goal is to have heavy assets in our swf, but would like to show a progress bar until all these assets have loaded.</p><h4>Assembling the asset library using SamHaxe</h4>
<p>
Let's see the <i>resource.xml</i> asset descriptor that we will feed for SamHaxe:
<pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shx:resources version="9" compress="false" package="resources.classes"
   xmlns:shx="http://mindless-labs.com/samhaxe"
   xmlns:snd="http://mindless-labs.com/samhaxe/modules/Sound"&gt;

   &lt;!-- 
      Empty first frame. You may put resources
      required in preloader animation here. 
   --&gt;
   &lt;shx:frame/&gt;

   &lt;!-- Frame with heavy assets --&gt;
   &lt;shx:frame&gt;
      &lt;snd:sound class="Music" import="path/to/a/large.mp3"/&gt;
   &lt;/shx:frame&gt;

&lt;/shx:resources&gt;
</pre>
</p><p>
The <i>package</i> attribute of the <i>shx:resources</i> tag is prepended to all classnames, so we will be able to access our sound asset from flash now as <i>resources.classes.Music</i>. Feel free to substitute your own asset package name.
</p><p>
Now we assemble the asset lib with SamHaxe by executing <i>SamHaXe --config /path/to/samhaxe.conf.xml resources.xml resources.swf</i>
</p>
<h4>Embedding the asset library in flash with Haxe</h4>
<p>
Here is the Haxe code which draw a progress bar until the whole flash file is loaded:
</p><p>
<pre>
class PreloadingDemo {

   // progress bar
   var progress: flash.display.Shape;
   var fully_loaded: Bool;

   public function new() {
      // background for the progress bar
      var progressBg = new flash.display.Shape();
      var g = progressBg.graphics;
      g.beginFill(0x002288);
      g.drawRect(-2, -2, 104, 14);
      flash.Lib.current.addChild(progressBg);
      progressBg.x = 10;
      progressBg.y = 10;

      // the progress bar itself
      progress = new flash.display.Shape();
      g = progress.graphics;
      g.beginFill(0x00ff88);
      g.drawRect(0, 0, 100, 10);
      flash.Lib.current.addChild(progress);
      progress.x = 10;
      progress.y = 10;

      fully_loaded = false;
      flash.Lib.current.addEventListener(flash.events.Event.ENTER_FRAME,
            onEnterFrame);
   }

   function onEnterFrame(e: flash.events.Event) {
      var totalBytes = flash.Lib.current.loaderInfo.bytesTotal;
      var actBytes = flash.Lib.current.loaderInfo.bytesLoaded;

      if (!fully_loaded && actBytes &lt;= totalBytes) {
         // animate progress bar
         progress.scaleX = 1.0 * actBytes / totalBytes;
      }

      if (!fully_loaded && actBytes == totalBytes) {
         fully_loaded = true;

         var music: flash.media.Sound = Type.createInstance(
              Type.resolveClass("resources.classes.Music"), []
         );
         music.play();
      }
   }

   public static function main() {
      new PreloadingDemo();
   }
}
</pre></p><p>
Now we can build this by issuing:<br/>
<i>haxe -swf preloadingDemo.swf -swf-header 100:100:20:ffffff -swf-version 9 -swf-lib resources.swf --flash-strict -main PreloadingDemo</i>
</p>
<h4>Discussion</h4>
This example can be found in the <i>demos</i> directory of the SamHaxe distribution. This is a minimal example, there is plenty of space for implementing fancier preloader animation, or splitting the resources over more frames, if certain resources may only be needed later in the game.</p>
<p>Note that all program code still resides in the first frame - a possible workaround for this is to compile a preloder-less fully functional swf, and embed it into a small preloader shell on the second frame as a binary object using <i>shx:binary</i>, and using <i>flash.display.Loader.loadBytes()</i> to load and execute it.</p>
<p>
Have fun coding :)
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>SamHaXe: an swfmill alternative flash asset lib assembler</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/09/10/SamHaXe_an_swfmill_alternative_flash_asset_lib_assembler" />
		<updated>2009-09-10T12:43:00-00:00</updated>
		<published>2009-09-10T12:43:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.42</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Version 1.0 of our new tool called SamHaXe is now available for testing! It is a command-line asset library assembler for flash (currently flash9 and 10 are targeted - later flash versions may be supported in newer versions of SamHaXe, if demanded :). You enumerate the resources you want to import (sounds, images, fonts, text files, binary files, other swf files) in a resource description file, and SamHaXe assembles a nice swf from them, which you can then use in your flash projects.


SamHaXe was written in HaXe targeting nekovm, so it can be run on both Linux, Windows and Mac platforms. You can even write your own import plugins (see the Module API section in the documentation)!


You can download the source or prebuilt windows binaries from http://mindless-labs.com/trac/samhaxe . Please read the text carefully, as you still need to install FreeType and ImageMagick for the prebuilt binary and update the configuration file. Once installed, you can find plenty of documentation and examples at http://mindless-labs.com/samhaxe/doc/1.0/ .</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/09/10/SamHaXe_an_swfmill_alternative_flash_asset_lib_assembler"><![CDATA[
                <p>Version 1.0 of our new tool called <b>SamHaXe</b> is now available for testing! It is a <b>command-line asset library assembler for flash</b> (currently flash9 and 10 are targeted - later flash versions may be supported in newer versions of SamHaXe, if demanded :). You enumerate the <b>resources you want to import (sounds, images, fonts, text files, binary files, other swf files)</b> in a resource description file, and SamHaXe assembles a nice swf from them, which you can then use in your flash projects.
</p>
<p>
SamHaXe was written in HaXe targeting nekovm, so it can be run on both Linux, Windows and Mac platforms. You can even write your own import plugins (see the Module API section in the documentation)!
</p>
<p>
You can download the source or prebuilt windows binaries from <a rel="external" href="http://mindless-labs.com/trac/samhaxe">http://mindless-labs.com/trac/samhaxe</a> . Please read the text carefully, as you still need to install FreeType and ImageMagick for the prebuilt binary and update the configuration file. Once installed, you can find plenty of documentation and examples at <a rel="external" href="http://mindless-labs.com/samhaxe/doc/1.0/">http://mindless-labs.com/samhaxe/doc/1.0/</a> .</p>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Haxe Game Development: Call for Article Request</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/07/31/Haxe_Game_Development_Call_for_Article_Request" />
		<updated>2009-07-31T23:48:00-00:00</updated>
		<published>2009-07-31T23:48:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.41</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">As you may know, we deal with flash game development. There are currently not too many game development articles for Haxe, so please feel free to leave a comment with the topic you would like to read about, and we will do our best to confort you with code, articles and tutorials. Happy coding!</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/07/31/Haxe_Game_Development_Call_for_Article_Request"><![CDATA[
                As you may know, we deal with flash game development. There are currently not too many game development articles for Haxe, so please feel free to leave a comment with the topic you would like to read about, and we will do our best to confort you with code, articles and tutorials. Happy coding!
<p/>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Payment providers</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/07/13/Payment_providers" />
		<updated>2009-07-13T21:38:00-00:00</updated>
		<published>2009-07-13T21:38:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.40</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">Some alternative payment providers for running your own virtual curreny system:

Gambit
Super Rewards
Offerpal
AdParlor
Sometrics</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/07/13/Payment_providers"><![CDATA[
                Some alternative payment providers for running your own virtual curreny system:
<ul>
<li><a rel="external" href="http://getgambit.com">Gambit</a></li>
<li><a rel="external" href="http://www.srpoints.com/">Super Rewards</a></li>
<li><a rel="external" href="http://www.offerpalmedia.com/">Offerpal</a></li>
<li><a rel="external" href="http://www.adparlor.com/">AdParlor</a></li>
<li><a rel="external" href="http://sometrics.com/">Sometrics</a></li>
</ul>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Asset library and pure Haxe preloader tool</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/07/03/Asset_library_and_pure_Haxe_preloader_tool" />
		<updated>2009-09-24T17:46:00-00:00</updated>
		<published>2009-07-03T19:26:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.39</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">After KukkerMan's idea we have started a Haxe/neko project aiming to be able to assemble flash9+ resource libraries. The tool will be easily compilable on both Linux and Windows (and supposedly Mac?) as it is written for the nekovm target with as minimal external library dependencies as possible.
People will also be able to extend it via plugins to support importing their favourite formats into the library swf. So far we use it with success for importing png, jpg, alpha-masked jpeg images, binary data and mp3 sound into the asset library. As it turned out, the since far sought pure Haxe-based preloading is also possible via the tool. Read on for some insight!

(Edit: Don't forget to check out our latest article Preloading with Haxe and SamHaxe on the topic!)</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/07/03/Asset_library_and_pure_Haxe_preloader_tool"><![CDATA[
                After KukkerMan's idea we have started a <b>Haxe/neko project</b> aiming to be able to <b>assemble flash9+ resource libraries</b>. The tool will be easily compilable on both Linux and Windows (and supposedly Mac?) as it is written for the nekovm target with as minimal external library dependencies as possible.
<p>People will also be able to extend it via plugins to support importing their favourite formats into the library swf. So far we use it with success for importing png, jpg, alpha-masked jpeg images, binary data and mp3 sound into the asset library. As it turned out, the since far sought pure Haxe-based preloading is also possible via the tool. Read on for some insight!

<p><i>(Edit: Don't forget to check out our latest article <a rel="external" href="http://mindless-labs.com/blog/archive/2009/09/20/Preloading_example_with_Haxe_and_SamHaxe">Preloading with Haxe and SamHaxe</a> on the topic!)</i></p><p>
KukkerMan does a nice work implementing the <b>modular import system</b>: The asset library is described with an xml file, something like swfmill's simple format. However, a separate configuration xml file describes which tags are handled by which import modules. For example, the <i>image</i> tag is currently handled by our default Image plugin, but you could easily change that in the configuration file. <i>(By the way, KukkerMan had hard time trial-and-erroring how to use the poorly documented ImageMagick library, and is now considering to throw the whole code into trash and restart with a better library :)</i>
<p>
About <b>preloading with Haxe</b>: I implemeted the Sound import module, currently with mp3 support and more to come. For that, the hxformat lib was extended with mp3 support (more to come of course). When testing the sound import, placing the DefineSound swf tag on the second frame of the asset lib made the flashplayer cry out loud. It had a SymbolClass exported. After experimenting, it turned out that flash requires (? correct me, I'm not an AVM2 insider) an AS3 class definition for resources with a SymbolClass.
<p>
But you can say: <i>"Hey, I use an asset lib with Haxe and I don't write class definitions for my assets!"</i> Well, that works because Haxe generates the class stubs for you if this is the case. <i>"Ok, but then why did you get that error?"</i> That happened because Haxe only generates these class stubs for resources on the first frame of the asset lib.
<p>
So basically if you can generate class stubs for those resources, you can put all your heavy assets on the <s>first</s> second frame, wait with Haxe code for the whole file to load (possibly displaying preloader gfx), and continue executing rest of the code once the whole file (or at least the required frames) are ready. How to generate class stubs?
<ol>
<li>You can do that by hand, creating simple class definitions with a constructor calling super(), with Haxe. The stubs will be on frame 1, but they don't eat up much space.
<li>Or you can generate an AS3 code block along with the asset onto the frame it resides (frame 2 currently). I tried this and seems to work nice (not sure about generating a code block for frame1 would not collide with Haxe, I will have to research this later).
</ol>
For generating the code blocks I use the hxformat abc library with minor modifications. The core is:
<pre>
      // ctx is the format.abc.Context
      var cl = ctx.beginClass(_name, true); 
      cl.superclass = ctx.type("flash.media.Sound");
      ctx.endSubClass();
      ctx.finalize();
</pre>
Here you may spot two differences from the standard lib. First, beginClass() has a second <i>true</i> parameter. With this I tell it to call the superclass constructor, resulting in the following code inside the method:
<pre>
      ...
      beginFunction([],null);
      var cst = curFunction.f.type;
      curFunction.f.maxStack=1;
      if (callsuper) {    // this block was added
         op(OThis);
         op(OConstructSuper(0));
      }
      op(ORetVoid);
      endFunction();
      ...
</pre>
Also, the endSubClass() method was added with the minor difference from endClass() that it registers the class name as inheriting from the proper superclass. This solution is not a general one, but is a good starting point for now.
<p>
As a <b>bottom line</b>, this tool would prove to be useful and is an interesting challenge, so I hope that we are able to have an initial release in some weeks time. In the meanwhile (or during the meanwhile, Brian? :) you can try to guess the name of the tool, you get three hints for this:
<ol>
<li>Assets are not only important for flash developers, but also for whom? 
<li>Let's hope that this friendly tool won't inform on you to the FBI ;)
<li><i>???</i>
</ol>
Have fun coding!
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>Haxe/Flash for IPhone</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/05/22/HaxeFlash_for_IPhone" />
		<updated>2009-05-22T11:37:00-00:00</updated>
		<published>2009-05-22T11:24:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.38</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">HaXe is a great language - if its main developer Nicolas Cannasse did not convince you yet, hot news about Haxe to IPhone compilation surely will.
This way Flash developers dropping "HaXe can compile to Flash? And what? So can AS3" will be comforted to use familiar language constructs and emulated Flash API with flash.display.Sprite and pals, for targeting Flash and IPhone with the same code.
Now go and fire up HaXe! ;)</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/05/22/HaxeFlash_for_IPhone"><![CDATA[
                HaXe is a great language - if its main developer Nicolas Cannasse did not <a rel="external" href="http://haxe.org/manual/1_intro" title="">convince you</a> yet, hot news about <a rel="external" href="http://gamehaxe.com/2009/05/22/haxe-on-iphone-simulator/" title="">Haxe to IPhone</a> compilation surely will.
<p>This way Flash developers dropping <i>"HaXe can compile to Flash? And what? So can AS3"</i> will be comforted to use familiar language constructs and emulated Flash API with flash.display.Sprite and pals, for <b>targeting Flash and IPhone with the same code</b>.</p>
<p>Now go and fire up <a rel="external" href="http://haxe.org" title="">HaXe</a>! ;)</p>
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
	<entry>
		<title>ssh tunneling in linux</title>
		<link rel="alternate" type="text/html" href="http://www.mindless-labs.com/blog/archive/2009/05/14/ssh_tunneling_in_linux" />
		<updated>2009-05-14T10:28:00-00:00</updated>
		<published>2009-05-14T10:28:00-00:00</published>
		<id>tag:mindlesslabsdevblog,2011:MindlessLabsdevblog.37</id>
		<link rel="related" type="text/html" href=""  />
		<summary type="text">To forward the local port X to the local port Y of the remote machine:
ssh -L X:127.0.0.1:Y remote.machine -N
Usage example: Setup a local web proxy (like privoxy) on a remote university machine, and connect to it from home. This way you can access university resources with ease.</summary>
        <content type="html" xml:lang="en" xml:base="http://www.mindless-labs.com/blog/archive/2009/05/14/ssh_tunneling_in_linux"><![CDATA[
                To forward the local port X to the local port Y of the remote machine:
<p>ssh -L X:127.0.0.1:Y remote.machine -N
<p>Usage example: Setup a local web proxy (like privoxy) on a remote university machine, and connect to it from home. This way you can access university resources with ease.
		]]></content>
		<author>
			<name>ron</name>
		</author>
	</entry>
	
	
	
</feed>

