<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Przemysław &#039;rezoner&#039; Sikorski</title>
	<atom:link href="http://rezoner.net/feed" rel="self" type="application/rss+xml" />
	<link>http://rezoner.net</link>
	<description>Javascript programmer, experimentator, gamedeveloper</description>
	<lastBuildDate>Thu, 16 May 2013 11:53:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
	<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2F&amp;language=en_US&amp;category=text&amp;title=Przemys%C5%82aw+%26%23039%3Brezoner%26%23039%3B+Sikorski&amp;description=Javascript+programmer%2C+experimentator%2C+gamedeveloper&amp;tags=blog%2C+flattr" type="text/html" />
		<item>
		<title>Qb Qb Qb &#8211; Trailer</title>
		<link>http://rezoner.net/qb-qb-qb-trailer,820</link>
		<comments>http://rezoner.net/qb-qb-qb-trailer,820#comments</comments>
		<pubDate>Thu, 16 May 2013 11:53:37 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[qbqbqb]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=820</guid>
		<description><![CDATA[A trailer from extended version of what i&#8217;ve done for Ludum Dare #26 It is HTML5 The full version is coming to IOS/Android using CocoonJS Windows/OSX/Linux &#8211; If I manage to port it using node-webkit]]></description>
			<content:encoded><![CDATA[<p>A trailer from extended version of what i&#8217;ve done for Ludum Dare #26</p>
<p>It is HTML5</p>
<p>The full version is coming to IOS/Android using CocoonJS<br />
Windows/OSX/Linux &#8211; If I manage to port it using node-webkit</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/1MHVFo1XSSM" frameborder="0" allowfullscreen></iframe></p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=820&amp;md5=322c23fbaf4333c4e5670fe2c6122035" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/qb-qb-qb-trailer,820/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fqb-qb-qb-trailer%2C820&amp;language=en_GB&amp;category=text&amp;title=Qb+Qb+Qb+%26%238211%3B+Trailer&amp;description=A+trailer+from+extended+version+of+what+i%26%238217%3Bve+done+for+Ludum+Dare+%2326+It+is+HTML5+The+full+version+is+coming+to+IOS%2FAndroid+using+CocoonJS+Windows%2FOSX%2FLinux+%26%238211%3B+If+I+manage...&amp;tags=gamedev%2Chtml5%2Cjavascript%2Cqbqbqb%2Cblog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>HTML5 Highlights #1</title>
		<link>http://rezoner.net/html5-highlights-1,805</link>
		<comments>http://rezoner.net/html5-highlights-1,805#comments</comments>
		<pubDate>Sun, 05 May 2013 22:51:42 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=805</guid>
		<description><![CDATA[Sorry for not posting too much recently. I have so many projects going on. Still I am very active in aggregating html5 related **everything** so hope that I can at least save you some time on crawling the internets: Heroine &#8230; <a href="http://rezoner.net/html5-highlights-1,805">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sorry for not posting too much recently. I have so many projects going on. Still I am very active in aggregating html5 related **everything** so hope that I can at least save you some time on crawling the internets:</p>
<h2>Heroine Dusk</h2>
<p>HTML5 dungeon crawler by <a href="https://twitter.com/clintbellanger">clintbellanger</a> and <a href="https://soundcloud.com/yubatake/">yubatake</a></p>
<p>I encourage you to look at the game source if it is still unobfuscated. Procedural programming at its best &#8211; haven&#8217;t expected that it can be so clean and readable.</p>
<p>Brilliant assets, lovely graphics and &#8230; this music &#8211; it really compares to the one of the best <a href="http://www.youtube.com/watch?v=DNXMfRvEN28">theme songs</a> ever created.<br />
<a href="http://heroinedusk.com/"><br />
<img src="http://heroinedusk.com/images/screens/town.png" width=30%/> <img src="http://heroinedusk.com/images/screens/villainess.png" width=30%/> <img src="http://heroinedusk.com/images/screens/shop.png" width=30%/><br />
</a></p>
<h2>Ludum Dare #26 Highlights</h2>
<p>My totally non objective picks for the best browser based games on LD26. There are a lot of entries with awesome assets &#8211; but I am posting only these which also have immersive GAMEplay</p>
<h3>Gods will be watching</h3>
<p>Hell yes they will. Great psychological portraits of characters. Really easy to identify with the main character. Awesome point-and-clickish graphics. </p>
<p><a href="http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&#038;uid=11045"><img src="http://www.ludumdare.com/compo/wp-content/compo2/thumb/33e073e6afdafaab43f9a477aaf8e0d7.jpg"/></a></p>
<h3>Unfurl</h3>
<p>Deserves more comments &#8211; one of the most interesting and polished games on this LD.</p>
<p><a href="http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&#038;uid=23493"><img src="http://www.ludumdare.com/compo/wp-content/compo2/thumb/565495351ed2c3612b1ae2aeba015721.jpg"/></a></p>
<h3>Budget Squad</h3>
<p>Great atmosphere, super polished &#8211; I don&#8217;t like the gameplay(!!!) but it has so much potential that I hope the author will work something out of this.</p>
<p><a href="http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&#038;uid=2982"><img src="http://www.ludumdare.com/compo/wp-content/compo2/thumb/268fd19855c2c466e53a3c2602309463.jpg"/></a></p>
<h2>Tech stuff</h2>
<h3>Verlet.js</h3>
<p><a href="http://subprotocol.com/verlet-js/examples/spiderweb.html">Verlet.js</a> &#8211; implementation of verlet physics in javascript. Not super useful thing, but I bet a great designer can come up with something interesting.</p>
<h3>Phaser by PhotonStorm</h3>
<p><a href="http://gametest.mobi/phaser/"><br />
<img src="http://www.photonstorm.com/wp-content/uploads/2013/04/phaser_cams.png" width=320/><br />
</a></p>
<p><a href="http://gametest.mobi/phaser/">Phaser</a> &#8211; blossoming gamedev library &#8211; I hate frameworks and stuff &#8211; what makes it different then? </p>
<ul>
<li>It is made by people who are in gamedev for more than a decade &#8211; meaning &#8211; the solutions are responses to real problems not some made up stuff.</li>
<li>It is not a framework. It is a bunch of solutions which you can use separately with no fixed code architecture.</li>
<li>It is not a student project. A lot of prominent gamedev personas are involved.</li>
<li>Very little of abstraction &#8211; no lousy attempts to bring clike inheritance into js &#8211; (god please punish them who try to fix what is not broken)
</li>
</ul>
<h3>Javascript Dubstep Generator</h3>
<p><a href="http://www.mazbox.com/synths/dubstep/">mazbox/synths/dubstep/</a> &#8211; still better than dubstep produced by some djs.</p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=805&amp;md5=e230c3ccfd7a77606c7107d5fe4411ab" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/html5-highlights-1,805/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fhtml5-highlights-1%2C805&amp;language=en_GB&amp;category=text&amp;title=HTML5+Highlights+%231&amp;description=Sorry+for+not+posting+too+much+recently.+I+have+so+many+projects+going+on.+Still+I+am+very+active+in+aggregating+html5+related+%2A%2Aeverything%2A%2A+so+hope+that+I+can+at...&amp;tags=html5%2Cblog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>My LD#26 entry Qb, Qb, Qb</title>
		<link>http://rezoner.net/my-ld26-entry-qb-qb-qb,802</link>
		<comments>http://rezoner.net/my-ld26-entry-qb-qb-qb,802#comments</comments>
		<pubDate>Sun, 05 May 2013 22:10:43 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[qbqbqb]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=802</guid>
		<description><![CDATA[Done in 20 hours. Hope I will find time to write some followups as the game has been quite warmly welcomed by the dev community. Click the image:]]></description>
			<content:encoded><![CDATA[<p>Done in 20 hours.</p>
<p>Hope I will find time to write some followups as the game has been quite warmly welcomed by the dev community.</p>
<p>Click the image:<br />
<a href="http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&#038;uid=21594"><br />
<img src="http://www.ludumdare.com/compo/wp-content/compo2/233892/21594-shot0.gif" width=320/><br />
</a></p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=802&amp;md5=eef8b91cb597883d73961f7352a1e08c" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/my-ld26-entry-qb-qb-qb,802/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fmy-ld26-entry-qb-qb-qb%2C802&amp;language=en_GB&amp;category=text&amp;title=My+LD%2326+entry+Qb%2C+Qb%2C+Qb&amp;description=Done+in+20+hours.+Hope+I+will+find+time+to+write+some+followups+as+the+game+has+been+quite+warmly+welcomed+by+the+dev+community.+Click+the+image%3A&amp;tags=qbqbqb%2Cblog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>Anitroubles &#8211; my tiny survival-puzzle game</title>
		<link>http://rezoner.net/anitroubles-my-tiny-survival-puzzle-game,799</link>
		<comments>http://rezoner.net/anitroubles-my-tiny-survival-puzzle-game,799#comments</comments>
		<pubDate>Mon, 08 Apr 2013 20:05:51 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gamedev]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=799</guid>
		<description><![CDATA[Here it is Also available on Mozilla Marketplace Bonus &#8211; work in progress title for the next version:]]></description>
			<content:encoded><![CDATA[<p><a href="http://anitroubles.com">Here it is<br />
  <img src="http://anitroubles.com/press/screenshot2.png"/><br />
</a></p>
<p>Also available on <a href="https://marketplace.firefox.com/app/anitroubles/"><br />
<img src="https://marketplace.cdn.mozilla.net/media/img/mkt/logos/mp_aurora_wordmark_large.png?e077e85"/><br />
Mozilla Marketplace</a></p>
<p>Bonus &#8211; work in progress title for the next version:<br />
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F86698287&amp;color=ff6600&amp;auto_play=false&amp;show_artwork=true"></iframe></p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=799&amp;md5=36c3b569fea7f44cbf58264e1c592a43" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/anitroubles-my-tiny-survival-puzzle-game,799/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fanitroubles-my-tiny-survival-puzzle-game%2C799&amp;language=en_GB&amp;category=text&amp;title=Anitroubles+%26%238211%3B+my+tiny+survival-puzzle+game&amp;description=Here+it+is+Also+available+on+Mozilla+Marketplace+Bonus+%26%238211%3B+work+in+progress+title+for+the+next+version%3A&amp;tags=gamedev%2Cblog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>CanvasQuery 0.8 is out</title>
		<link>http://rezoner.net/canvasquery-0-8-is-out,765</link>
		<comments>http://rezoner.net/canvasquery-0-8-is-out,765#comments</comments>
		<pubDate>Sun, 10 Feb 2013 20:39:47 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=765</guid>
		<description><![CDATA[This time I&#8217;ve prepared an interactive demo of new features for you. Guess the hottest addition is borderImage which is a first step for making a GUI library Read more at canvasquery.com]]></description>
			<content:encoded><![CDATA[<p>This time I&#8217;ve prepared an <a href="http://cssdeck.com/labs/full/canvas-query-08-whats-new">interactive demo</a> of new features for you. Guess the hottest addition is borderImage which is a first step for making a GUI library <img src="http://rezoner.net/articles/canvas-query/korgoth.png"/></p>
<p>Read more at <a href="http://canvasquery.com/">canvasquery.com</a></p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=765&amp;md5=84fd7a058710523d090142074460294c" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/canvasquery-0-8-is-out,765/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fcanvasquery-0-8-is-out%2C765&amp;language=en_GB&amp;category=text&amp;title=CanvasQuery+0.8+is+out&amp;description=This+time+I%26%238217%3Bve+prepared+an+interactive+demo+of+new+features+for+you.+Guess+the+hottest+addition+is+borderImage+which+is+a+first+step+for+making+a+GUI+library+Read+more...&amp;tags=blog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>Multiplatform javascript games &#8211; CocoonJS &#8211; tools, pitfalls, tips and thoughts</title>
		<link>http://rezoner.net/multiplatform-javascript-games-cocoonjs-tools-pitfalls-tips-and-thoughts,741</link>
		<comments>http://rezoner.net/multiplatform-javascript-games-cocoonjs-tools-pitfalls-tips-and-thoughts,741#comments</comments>
		<pubDate>Sun, 10 Feb 2013 01:07:04 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=741</guid>
		<description><![CDATA[This is based on my experience gained while porting anitroubles to IOS/Android. Why CocoonJS? Phonegap is uncomparably slow. Ejecta is IOS only. Haven&#8217;t tried Titanium SDK. I can&#8217;t afford mobile device Q: How to develop IOS/Android app for free? A: &#8230; <a href="http://rezoner.net/multiplatform-javascript-games-cocoonjs-tools-pitfalls-tips-and-thoughts,741">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is based on my experience gained while porting <a href="http://www.youtube.com/watch?v=EHJBblQcCWY">anitroubles</a> to<br />
IOS/Android. </p>
<p><img src="http://blog.ludei.com/wp-content/uploads/2012/05/LogoCocoonJS.png" height=128/></p>
<h2>Why CocoonJS?</h2>
<p><a href="http://phonegap.com/" target="_blank">Phonegap</a> is uncomparably slow. <a href="http://impactjs.com/ejecta" target="_blank">Ejecta</a> is IOS only. Haven&#8217;t tried <a href="http://www.appcelerator.com/platform/titanium-sdk/" target="_blank">Titanium SDK</a>.</p>
<h2>I can&#8217;t afford mobile device</h2>
<pre>Q: How to develop IOS/Android app for free?
A: It is impossible.</pre>
<p>However a bunch of thoughts on that:</p>
<ul>
<li>Android emulator: you would need a google supercomputer to fluently run this software. Don&#8217;t even try the one bundled with SDK. You can give a try to <a href="http://www.android-x86.org/download" target="_blank">x86 port</a> &#8211; however it still requires fast VM to work + I failed to configure the network.</li>
<li><a tatget="_blank" href="https://developer.blackberry.com/html5/download/">Ripple Emulator</a>: great tool from BlackBerry &#8211; it won&#8217;t simulate an IOS device, but it is a nice playground with features like touch events, accelerometer and orientation change. Also has ability to run cordova/phoengap libs if you are going to write an app rather than a game.</li>
<li><a href="http://www.browserstack.com/" tatget="_blank" >BrowserStack</a> &#8211; not free but kinda cheap.</li>
<li>Consider buying new phone number/internet which is offered with a tablet (thanks <a href="https://twitter.com/llamapixel" target="_blank">@llamapixel)</a></li>
<li>If you are Windows user &#8211; this might be useful &#8211; <a href="http://www.electricplum.com/" target="_blank">Electric Mobile Studio</a></li>
</ul>
<h2>CocoonJS pitfalls</h2>
<p>Here is the <a href="http://wiki.ludei.com/cocoonjs:devguide">Hello World</a>. The documentation and knowledge sources are really inconsistent and scattered so below are some traps you might fall into (as I did):</p>
<ul>
<li>It has DOM elements only essential for gamedevelopment. Which means the only element you can use for view is Canvas. If you prefer making the games with jQuery/css &#8211; first of you are doing it wrong &#8211; second &#8211; try phonegap.</li>
<li>All the elements has to be created via javascript at runtime (html will be ignored)
<pre>var screenCanvas = document.createElement("Canvas");
document.body.appendChild(screenCanvas);</pre>
</li>
<li>The screen is adjusted to the first created canvas element. <b>this is uber !important if you are doing some pre-rendering using canvas element before initializing the view</b></li>
<li>CocoonJS is so fast because it uses OpenGL to render the stuff &#8211; however if you are not familiar with it you would never guess that &#8211; <b>texture size dimensions has to be power of two</b> &#8211; examples: 32&#215;32, 64&#215;64, 128&#215;128, 256&#215;256 and so on &#8211; or enjoy the artifacts &#8211; and there is no emphasis on that in documentation.
</li>
</ul>
<h2>Other platforms</h2>
<h3>Firefox OS</h3>
<p><img src="http://people.mozilla.com/~faaborg/files/shiretoko/firefoxIcon/firefox-512-noshadow.png" width=48 /></p>
<p>It is really easy to get your thing working on <a target="_blank" href="http://www.mozilla.org/en-US/firefoxos/">FirefoxOs</a> + you can test it without any compatible device using <a target="_blank" href="https://addons.mozilla.org/en-us/firefox/addon/firefox-os-simulator/">simulator plugin</a>.
</p>
<h3>Linux / OSX / Windows</h3>
<p><img width=48 src="http://design.ubuntu.com/wp-content/uploads/logo-ubuntu_cof-orange-hex.svg" /> <img width=48 src="http://rezoner.net/articles/temp/mslogo.png" /> <img width=48 src="http://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg" /></p>
<p>
Try <a href="http://www.tidesdk.org/" target="_blank">Tide SDK</a> &#8211; You can easily create desktop application using variety of web technologies like javascript, ruby, php, css, html5. I think you could even try to hit Valve&#8217;s Steam with a decent game.
</p>
<p>I will update this article according to my further experience</p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=741&amp;md5=4575de89e5f573f8b5a801dc310a93ac" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/multiplatform-javascript-games-cocoonjs-tools-pitfalls-tips-and-thoughts,741/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fmultiplatform-javascript-games-cocoonjs-tools-pitfalls-tips-and-thoughts%2C741&amp;language=en_GB&amp;category=text&amp;title=Multiplatform+javascript+games+%26%238211%3B+CocoonJS+%26%238211%3B+tools%2C+pitfalls%2C+tips+and+thoughts&amp;description=This+is+based+on+my+experience+gained+while+porting+anitroubles+to+IOS%2FAndroid.+Why+CocoonJS%3F+Phonegap+is+uncomparably+slow.+Ejecta+is+IOS+only.+Haven%26%238217%3Bt+tried+Titanium+SDK.+I+can%26%238217%3Bt+afford+mobile...&amp;tags=blog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>Javascript classes, components and bullshit #1</title>
		<link>http://rezoner.net/javascript-classes-components-and-bullshit-1,698</link>
		<comments>http://rezoner.net/javascript-classes-components-and-bullshit-1,698#comments</comments>
		<pubDate>Sat, 02 Feb 2013 13:43:26 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=698</guid>
		<description><![CDATA[Don&#8217;t overcomplicate things &#8211; in most cases all you need are mixins with some variations. [inlineadh] 1. Manipulator I just made up this name. It consists of universal methods that can be applied to any other object in order to &#8230; <a href="http://rezoner.net/javascript-classes-components-and-bullshit-1,698">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t overcomplicate things &#8211; in most cases all you need are <a href="http://www.joezimjs.com/javascript/javascript-mixins-functional-inheritance/">mixins</a> with some variations.</p>
<p>[inlineadh]</p>
<h2>1. Manipulator</h2>
<p>I just made up this name. It consists of universal methods that can be applied to any other object in order to <b>manipulate</b> its properties.</p>
<pre class="sh_javascript">
/* physics - constructor manipulator */

var Physics = function(object) {
  object.v = [0, 0];
  object.forces = [ ];
  object.x = 0;
  object.y = 0;
};

_.extend(Physics, {
  
  addForce: function(object, x, y) { 
    object.forces.push([x, y]);
  }, 

  stop: function(object) { 
    object.forces = [ ];
  },
 
  step: function(object, delta) { ... }

});
</pre>
<p>Ok, now some object that will use these physics superpowers.</p>
<pre class="sh_javascript">var Soldier = function(args) {
  Physics(this);
};

Soldier.prototype = {
  step: function(delta) {
    Physics.step(this, delta)

    /* some other behaviours for the soldier,
       for example - self healing with no limits*/

    this.hp++;
  },

  jump: function() {
    Physics.addForce(this, 0, -100);
  }
};
</pre>
<p>If you don&#8217;t like passing the object each time you may prefer apply/call approach instead:</p>
<pre>var Physics = function() {

  /* note that there is no `object` anymore */
  this.x = 0;
  this.y = 0;
};

var Soldier = function() {
  Physics.apply(this, arguments);
};</pre>
<p>We used apply to pass &#8220;this&#8221; context to a certain Physics method.</p>
<p><a class="button example" href="http://cssdeck.com/labs/object-oriented-approaches-in-javascript" target="_blank">Live example</a></p>
<h2>2. Extending the prototype</h2>
<p>Like in the previous example we have constructor manipulator &#8211; but then we extend an object&#8217;s prototype &#8211; so we can call new methods directly using &#8220;this.method&#8221;</p>
<pre class="sh_javascript">
var Sprite = function(object) {
  object.spriteAnimation = null;
  object.spriteFrame = null;  
};

_.extend(Sprite, {

  /* I am prefixing every property to
   * decrease a chance for naming conflicts */
  spriteStep: function() { ... },
  spriteSetAnimation: function() { ... },
  render: function(ctx) { ... }
});

var Enemy = function() {
  Sprite(this);
};

Enemy.prototype = {
  changeStance: function(stance) {
    this.stance = stance;
    this.spriteSetAnimation("enemy-" + stance);
  },

  render: function(ctx) {
    this.spriteRender(ctx);
  }
};

_.extend(Enemy.prototype, Sprite);
</pre>
<h2>Simple inheritance</h2>
<p>You don&#8217;t really need magical javascript `class` systems for it.</p>
<pre class="sh_javascript">/* base `class` for all controls, components, widgets or how do you call them */
function GuiComponent() {
  this.border = "2px solid #000000";
  this.foreground = "#444444";
  this.background = "#fafafa";
};

GuiComponent.prototype = {
  redraw: function() { },
  onMouseDown: function() { ... }
};

/* simple button */

function GuiButton() {

  /* call the base contructor */
  GuiComponent.apply(this, arugments);
}

GuiButton.prototype = {
  redraw: function() {

    /* draw the button in its own specific way */
  },

  onMouseDown: function() {
    
    /* call the mouse down from the base */
    GuiComponent.prototype.onMouseDown.apply(arguments);

    /* then do some other - button specific stuff */
  }
};
</pre>
<p>You might actually want to copy all the properties that are not defined from the base `class`.</p>
<pre>function inherit(object, parent) {
  for(var key in parent) {
    if(!object.hasOwnProperty(key)) {
      object[key] = parent[key];
    }
  }
};

inherit(GuiButton.prototype, GuiComponent.prototype);</pre>
<p>Be creative &#8211; you can easily forge your own `class` system that suits your needs using this approach. You can even add this parent thing if you miss it so much and don&#8217;t really need composition (you will be inheriting only from one object):</p>
<pre class="sh_javascript">GuiButton.prototype = {
  parent: GuiComponent,
  redraw: function() {
   
    /* omg so simple */
    this.parent.redraw();
  }
}
</pre>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=698&amp;md5=0150c2f38ae52dd4a9cd6ac4a955036e" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/javascript-classes-components-and-bullshit-1,698/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fjavascript-classes-components-and-bullshit-1%2C698&amp;language=en_GB&amp;category=text&amp;title=Javascript+classes%2C+components+and+bullshit+%231&amp;description=Don%26%238217%3Bt+overcomplicate+things+%26%238211%3B+in+most+cases+all+you+need+are+mixins+with+some+variations.+%5Binlineadh%5D+1.+Manipulator+I+just+made+up+this+name.+It+consists+of+universal+methods+that...&amp;tags=blog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>Preloading font-face using canvas</title>
		<link>http://rezoner.net/preloading-font-face-using-canvas,686</link>
		<comments>http://rezoner.net/preloading-font-face-using-canvas,686#comments</comments>
		<pubDate>Sat, 02 Feb 2013 09:24:23 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[utils]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=686</guid>
		<description><![CDATA[The problem General routine for loading resources in javascript goes like that: var image = new Image; image.onload = function() { /* some onReady callback */ }; image.src = "nude-princess-peach.png"; But for WebFonts there is no corresponding object which makes &#8230; <a href="http://rezoner.net/preloading-font-face-using-canvas,686">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>The problem</h1>
<p>General routine for loading resources in javascript goes like that:</p>
<pre class="sh_javascript">var image = new Image;
image.onload = function() { /* some onReady callback */ };
image.src = "nude-princess-peach.png";
</pre>
<p>But for WebFonts there is no corresponding object which makes it kind of difficult &#8211; especially when you want to write pure canvas app (for example compatible with CocoonJS)</p>
<h1>The solution</h1>
<p>First of &#8211; in chrome &#8211; using context.fillText with not-yet-loaded font-face &#8211; will execute properly &#8211; but with absolutely no visual result. So the basic idea is to set a timer which will be calling a drawing function until something actually appears on canvas. Detect the change. That&#8217;s it :)</p>
<p>As for firefox &#8211; if the font is not yet loaded it will fall back to default one which is &#8220;10px sans-serif&#8221; now to detect the change we just need to check if after assignment the font is still &#8220;10px sans-serif&#8221;.</p>
<h1>The implementation</h1>
<p><a class="button example" href="http://cssdeck.com/labs/font-face-preloader-using-canvas/0"  target="_blank">live example</a></p>
<p>There are many ways to detect that change &#8211; I will use <a href="http://canvasquery.com#trim">cq.trim()</a> but you can easily write any other method from scratch.</p>
<p>So basically &#8211; if I call a trim method on an empty image &#8211; it will not be trimmed at all &#8211; ergo &#8211; its dimensions will stay intact.</p>
<h2>Code</h2>
<p>I like to keep the same routine as in image or audio &#8211; so I am going to create object representing a font.</p>
<pre class="sh_javascript">var WebFont = function(fontName) {

  /* create some canvas that will be used to check
     if the font has been loaded */

  var placeholder = cq(64, 64);

  /* setup check timer */

  var timer = setInterval(function() {    

    /* save previous height */

    var previousHeight = placeholder.canvas.height;

    /* try to draw some text */

    placeholder.clear().font("32px " + fontName).fillText("test", 32, 32).trim();

    /* check for changes */

    if((window.mozIndexedDB &#038;&#038; placeholder.context.font !== "10px sans-serif") || (!window.mozIndexedDB &#038;&#038; placeholder.canvas.height !== previousHeight)) {
    
      /* eventually run ready callback and clear the timer */

      this.onload();
      clearInterval(timer);
    }
    
  }, 500);
}
</pre>
<h1>Usage</h1>
<p><b>example css:</b></p>
<pre class="sh_css">@import url(http://fonts.googleapis.com/css?family=Kavoon);</pre>
<p><b>example js:</b></p>
<pre class="sh_javascript">var font = new WebFont("Kavoon");
font.onload = function() { alert("Font has been loaded"); }</pre>
<p><a class="button example" href="http://cssdeck.com/labs/font-face-preloader-using-canvas/0"  target="_blank">live example</a></p>
<p>I am using this method in my WIP <a href="http://canvasquery.com/simploader.js" target="_blank">simploader.js</a> see example usage <a href="http://cssdeck.com/labs/canvas-query-08-whats-new" target="_blank">here</a></p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=686&amp;md5=b814b31246ae46f3953f197202e421ba" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/preloading-font-face-using-canvas,686/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fpreloading-font-face-using-canvas%2C686&amp;language=en_GB&amp;category=text&amp;title=Preloading+font-face+using+canvas&amp;description=The+problem+General+routine+for+loading+resources+in+javascript+goes+like+that%3A+var+image+%3D+new+Image%3B+image.onload+%3D+function%28%29+%7B+%2F%2A+some+onReady+callback+%2A%2F+%7D%3B+image.src+%3D+%22nude-princess-peach.png%22%3B...&amp;tags=canvas%2Ccss3%2Cfont-face%2Chtml5%2Cutils%2Cblog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>Tutorials that I would write if I had more time</title>
		<link>http://rezoner.net/tutorials-that-i-would-write-about-if-i-had-moretime,675</link>
		<comments>http://rezoner.net/tutorials-that-i-would-write-about-if-i-had-moretime,675#comments</comments>
		<pubDate>Sun, 27 Jan 2013 23:58:38 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=675</guid>
		<description><![CDATA[I will start to write down the ideas and discoveries before I forget. 1) Porting HTML5 game to: IOS, Android, Linux, Windows, Firefox OS 2) What to care about when working with CocoonJS 3) How to write a font-face loader &#8230; <a href="http://rezoner.net/tutorials-that-i-would-write-about-if-i-had-moretime,675">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I will start to write down the ideas and discoveries before I forget.</p>
<p>1) Porting HTML5 game to: IOS, Android, Linux, Windows, Firefox OS<br />
2) What to care about when working with CocoonJS<br />
3) How to write a font-face loader (I think this would be the first one)<br />
4) How to rescue bricked iPad using linux + windows on Virtual Box<br />
5) How to properly write a game/application that fits to screen &#8211; including window resize and orientation change<br />
6) How to emulate bitmap fonts and retro title screens using font-faces and canvas<br />
7) Some tutorials demonstrating touch events in Canvas Query microframework </p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=675&amp;md5=0481316005079d6a0fe64af87df3002c" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/tutorials-that-i-would-write-about-if-i-had-moretime,675/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Ftutorials-that-i-would-write-about-if-i-had-moretime%2C675&amp;language=en_GB&amp;category=text&amp;title=Tutorials+that+I+would+write+if+I+had+more+time&amp;description=I+will+start+to+write+down+the+ideas+and+discoveries+before+I+forget.+1%29+Porting+HTML5+game+to%3A+IOS%2C+Android%2C+Linux%2C+Windows%2C+Firefox+OS+2%29+What+to+care+about+when...&amp;tags=blog%2C+flattr" type="text/html" />
	</item>
		<item>
		<title>Haiku Sketchbook &#8211; my online drawing tool</title>
		<link>http://rezoner.net/haiku-sketchbook-my-online-drawing-tool,668</link>
		<comments>http://rezoner.net/haiku-sketchbook-my-online-drawing-tool,668#comments</comments>
		<pubDate>Tue, 22 Jan 2013 15:48:01 +0000</pubDate>
		<dc:creator>rezoner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rezoner.net/?p=668</guid>
		<description><![CDATA[How is it different from other tools of this kind? Most of them have no consistent brushes. Theirs philosophy is rather like &#8211; &#8220;look how many useless brushes I can implement&#8221;. So I have decided to pick just a few &#8230; <a href="http://rezoner.net/haiku-sketchbook-my-online-drawing-tool,668">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How is it different from other tools of this kind?</p>
<p>Most of them have no consistent brushes. Theirs philosophy is rather like &#8211; &#8220;look how many useless brushes I can implement&#8221;.</p>
<p>So I have decided to pick just a few which looks sketchy &#8211; there is save and share so you know &#8211; go nuts and let it spread :)</p>
<p><a href="http://rezoner.net/haiku"><br />
Haiku Sketchbook<br />
<img src="http://rezoner.net/haiku/thumb.png"/><br />
</a></p>
 <p><a href="http://rezoner.net/?flattrss_redirect&amp;id=668&amp;md5=3034d6897f486270255d5968d2a748ad" title="Flattr" target="_blank"><img src="http://rezoner.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rezoner.net/haiku-sketchbook-my-online-drawing-tool,668/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=rezoner&amp;popout=1&amp;url=http%3A%2F%2Frezoner.net%2Fhaiku-sketchbook-my-online-drawing-tool%2C668&amp;language=en_GB&amp;category=text&amp;title=Haiku+Sketchbook+%26%238211%3B+my+online+drawing+tool&amp;description=How+is+it+different+from+other+tools+of+this+kind%3F+Most+of+them+have+no+consistent+brushes.+Theirs+philosophy+is+rather+like+%26%238211%3B+%26%238220%3Blook+how+many+useless+brushes+I+can...&amp;tags=blog%2C+flattr" type="text/html" />
	</item>
	</channel>
</rss>
