<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Kat's Home</title>
    <description></description>
    <link>http://katrina.im/</link>
    <atom:link href="http://katrina.im/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Wed, 21 Dec 2016 07:19:08 +0000</pubDate>
    <lastBuildDate>Wed, 21 Dec 2016 07:19:08 +0000</lastBuildDate>
    <generator>Jekyll v3.3.1</generator>
    
      <item>
        <title>Reflections on My First Game</title>
        <description>&lt;p&gt;Hmm..Here is the thing…I made a game recently.&lt;/p&gt;

&lt;p&gt;And I put it on &lt;a href=&quot;http://awu.so/Journey/&quot;&gt;http://awu.so/Journey/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The whole process is super exciting for me.&lt;/p&gt;

&lt;p&gt;I enjoyed every second when I play with it.&lt;/p&gt;

&lt;p&gt;But…&lt;/p&gt;

&lt;p&gt;it turns out not as good as I expected.&lt;/p&gt;

&lt;p&gt;So I finally stop refining it and start to reflect on the whole thing.
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The basic game flow was completed.&lt;/p&gt;

&lt;p&gt;In the game you travels from town to town, and trade goods in towns’ markets. When travels you will meet monsters, you will fight monsters by play a game similar to puzzle and dragon. And you will get loot after fight.\n&lt;/p&gt;

&lt;p&gt;The first problem is that, there is two game system in the game: the trade system and the fight system.&lt;/p&gt;

&lt;p&gt;The trade system is that goods types and prices varies, so you can speculate on them.&lt;/p&gt;

&lt;p&gt;The fight system is quite tricky game.&lt;/p&gt;

&lt;p&gt;Both these two parts can be a single game. Now they are distracting.
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The second problem is, it lacks a story line as well as a growth curve. This problem was on the TO FIX LIST. But I may not fix it since the first problem makes the game’s integrity is not very well.
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The third problem is, the trade system calls for little amount of goods to make the trade fluent, but the fight system calls for more to make it exciting.
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Making game is quite time-consuming..Source materials take a lot of time to draw or collect. Bugs need a lot of time to be found.
But most important is thinking thoroughly before you make it.
Including develop platform, game type, game screen style, story, growth curve to keep player exciting.
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;I made a dream this afternoon =w=..it’s kind of a nightmare, but can be a good game.&lt;/p&gt;

&lt;p&gt;In the next step, I will take some time to prepare on the new game.&lt;/p&gt;

&lt;p&gt;BTW, if you see this post and play the game - Journey. Pls kindly leave some comments to me.
&lt;a href=&quot;&amp;#109;&amp;#097;&amp;#105;&amp;#108;&amp;#116;&amp;#111;:&amp;#107;&amp;#097;&amp;#116;&amp;#114;&amp;#105;&amp;#110;&amp;#097;&amp;#120;&amp;#120;&amp;#121;&amp;#064;&amp;#103;&amp;#109;&amp;#097;&amp;#105;&amp;#108;&amp;#046;&amp;#099;&amp;#111;&amp;#109;&quot;&gt;My Email&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 05 Sep 2014 16:53:00 +0000</pubDate>
        <link>http://katrina.im/2014/09/05/Reflections-on-My-First-Game/</link>
        <guid isPermaLink="true">http://katrina.im/2014/09/05/Reflections-on-My-First-Game/</guid>
        
        
      </item>
    
      <item>
        <title>Js Scope and Scope Chain</title>
        <description>&lt;p&gt;I found such a problem when I played with cocos2d-js:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;goods_today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cur_good&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;goods_today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;good_label&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;LabelTTF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;goods_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;cur_good&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;:&quot;&lt;/span&gt;
		&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;prices_today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Arial&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;good_item&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MenuItemLabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;good_label&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;buyIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;cur_good&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);},&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;that&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;market_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addChild&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;good_item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;It turned out that every MenuItemLabel got the last value of cur_good for its parameter for buyIn.&lt;/p&gt;

&lt;p&gt;For example, in “for” loop, cur_good got value 0, 1, 2, 3, but when I click these four MenuItemLabels, they all called buyIn(3).&lt;/p&gt;

&lt;p&gt;To explain the problem, there are two principles should be explained first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Scope&lt;/strong&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;p&quot;&gt;{},&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){},&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;does not mean a scope in javascript, only function(){} give us a scope.
e.g.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;global&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;  
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;local&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  
    &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;  
&lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Both alert will give us “local”, because if(){} does not make var “local” a local variable, so “global” is overwrited.&lt;/p&gt;

&lt;p&gt;So
for (var i in goods_today){}
equals to
var i;
for (i in goods_today)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Scope Chain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following codes explain how functions find variables.
when b() executes, it follows the sequence of b()-&amp;gt;a()-&amp;gt;window, b() find name in b(), and output “Scope3”
when c() executes, it follows the sequence of c()-&amp;gt;a()-&amp;gt;window, c() can not find name in c(), but find name in a(), and output “Scope2”&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Scope1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Scope2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Scope3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;//--&amp;gt;&quot;Scope3&quot;&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;	&lt;span class=&quot;c1&quot;&gt;//--&amp;gt;&quot;Scope2&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That explains why I got 4 “buyIn(3)”&lt;/p&gt;

&lt;p&gt;So I need to put these codes into a function to create a scope:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;goods_today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;that&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;good&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cur_good&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;goods_today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;good&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;good_label&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;LabelTTF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;goods_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;cur_good&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;:&quot;&lt;/span&gt;
			&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;prices_today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Arial&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;good_item&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MenuItemLabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;good_label&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
			&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;buyIn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;cur_good&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);},&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;that&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;market_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addChild&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;good_item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;})(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now it works well~&lt;/p&gt;
</description>
        <pubDate>Wed, 30 Jul 2014 14:52:23 +0000</pubDate>
        <link>http://katrina.im/2014/07/30/Js-Scope-and-Scope-Chain/</link>
        <guid isPermaLink="true">http://katrina.im/2014/07/30/Js-Scope-and-Scope-Chain/</guid>
        
        
      </item>
    
      <item>
        <title>Sketchs</title>
        <description>&lt;p&gt;Recent sketchs&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2014-03-21-1.jpg&quot; alt=&quot;HOBO&quot; /&gt;
&lt;img src=&quot;/images/2014-03-21-2.JPG&quot; alt=&quot;cat&quot; /&gt;
&lt;img src=&quot;/images/2014-03-21-3.jpg&quot; alt=&quot;feather&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 21 Mar 2014 20:00:23 +0000</pubDate>
        <link>http://katrina.im/2014/03/21/Sketchs/</link>
        <guid isPermaLink="true">http://katrina.im/2014/03/21/Sketchs/</guid>
        
        
      </item>
    
      <item>
        <title>Evaluation on Images</title>
        <description>&lt;p&gt;I implement an interesting tool to calculate the harmony of pictures.&lt;/p&gt;

&lt;p&gt;It is based on the algorithm described in former post&lt;/p&gt;

&lt;p&gt;It can used to compare two similar pictures,&lt;/p&gt;

&lt;p&gt;e.g.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Two color scheme for the webpage you created&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;A photo before &amp;amp; after adjustment&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is little meaning for compare the score for two absolutely different picture.&lt;/p&gt;

&lt;p&gt;Ok, let have a look at the demo evaluation page.&lt;/p&gt;

&lt;p&gt;Lower score indicates better performance.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/res/Image%20Harmony%20Evaluation.html&quot;&gt;Evaluation Page for Picture’s Harmony Score!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first two pairs of examples is provided by the paper which propose this algorithm, it appears that pictures keep align to the theory do have better(aka lower) score. Pictures with lower scores do look better than the ones with higher scores.&lt;/p&gt;

&lt;p&gt;But&lt;/p&gt;

&lt;p&gt;1.The ones have score 0 doesn’t necessary have a perfect performance because there are still difference for pictures keep align to the hue wheel which can be study for more.&lt;/p&gt;

&lt;p&gt;2.The most harmony ones are not necessary the attractive ones. Some ugly ones might got more attention.&lt;/p&gt;

&lt;p&gt;It remind me of the following joke…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-10-09.jpg&quot; alt=&quot;Joke&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 09 Oct 2013 07:54:23 +0000</pubDate>
        <link>http://katrina.im/2013/10/09/Evaluation-on-Images/</link>
        <guid isPermaLink="true">http://katrina.im/2013/10/09/Evaluation-on-Images/</guid>
        
        
      </item>
    
      <item>
        <title>Experiments on Color Harmony Evaluation and Adjustment</title>
        <description>&lt;p&gt;&lt;strong&gt;Part I: Color harmony evaluation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I evaluate two-color harmony with the theory and made a evaluation page.&lt;/p&gt;

&lt;p&gt;The harmony score calculated is adjusted according to such a use case “It looks harmony, impressive and not eyestrain as a background color scheme for ads”.&lt;/p&gt;

&lt;p&gt;Higher score indicates better scheme. Scheme with score lower than -0.5 is strongly not recommended. Scheme with score higher than 0.5 is quite safe and harmony.&lt;/p&gt;

&lt;p&gt;Evaluated colors are selected from some existing web pages.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/res/Color%20Harmony.html&quot;&gt;ColorHarmonyEvaluationPage&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Tue, 24 Sep 2013 07:54:23 +0000</pubDate>
        <link>http://katrina.im/2013/09/24/Experiments-on-Color-Harmony-Evaluation-and-Adjustment/</link>
        <guid isPermaLink="true">http://katrina.im/2013/09/24/Experiments-on-Color-Harmony-Evaluation-and-Adjustment/</guid>
        
        
      </item>
    
      <item>
        <title>Automatic adjustment on color scheme</title>
        <description>&lt;p&gt;Recently I am studying on how to create a color scheme automatically, so I collected some information related to color theory.
When we create a color scheme, we have full control on colors. How can we make sure the combination of the colors is harmony?
Let’s start with the basic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are three primary color(red, yellow, blue), and combinations of them, which can be described in a hue wheel:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-09-15-1.gif&quot; alt=&quot;HueWheel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Colors on the opposite position =, e.g. red and green, are called complimentary colors. They make strong conflict with each other as we all know, but they are not necessary can not work well with each other, because colors have two other properties：&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HSaturation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Saturation describe the strength of a color. Colors with low saturate have low contrast with each other.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-09-15-2.png&quot; alt=&quot;Saturation&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Value describe the brightness of a color. The difference between so called light blue and dark blue is their value.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-09-15-3.png&quot; alt=&quot;Value&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now we got the color space we called “HSV”. Although color space “RGB” we know it for better, but an rgb value is hard to understood by human.(But a “RGB” space can be easily displayed on a 2-dimension picture, so it’s wildly used on computers)&lt;/p&gt;

&lt;p&gt;So what’s the secret of good looking color schemes?&lt;/p&gt;

&lt;p&gt;Two main rules sounds simple and works well:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The relationship between colors’ hue.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The following is a harmonic templates on the hue wheel. A collection of colors that fall into the gray areas is considered to be harmonic. The templates may be rotated by an arbitrary angle. The harmony score can be calculated by formula (1), which adds up the distance between the hue of each pixel and the hue of the template.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-09-15-4.png&quot; alt=&quot;HueWheels&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-09-15-5.png&quot; alt=&quot;Formular&quot; /&gt;&lt;/p&gt;

&lt;p&gt;2.The relationship between colors’ saturation and value.&lt;/p&gt;

&lt;p&gt;Generally speaking, colors look good together when their values are varied, but their saturations are similar.
Let’s get some example and see what happens:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2013-09-15-6.jpg&quot; alt=&quot;Example&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The left scheme has the exactly same hues of the right scheme. But the left one has similar value for colors which makes people feel tired to see it. That is to say, they are all bright or all dark forcing your eyes struggle to find the defining line between each hue.&lt;/p&gt;

&lt;p&gt;So if you want a nice color scheme,&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Choose several dominant colors representing the style you need.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Adjust the hue of the dominant colors to some hue template given above.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add other colors while keep align to the hue template.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Make the saturation of the colors to be similar and vary the value of the colors.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And see what happens.&lt;/p&gt;

&lt;p&gt;Some example with “before” and “after” will be added soon. :D&lt;/p&gt;

&lt;p&gt;Reference: “Color Harmonization,” by Daniel Cohen-Or et al., ACM Transactions on Graphics (TOG), Volume 25:3, July 2006. Proceedings of ACM SIGGRAPH 2006, pp. 624&lt;/p&gt;
</description>
        <pubDate>Sun, 15 Sep 2013 07:54:23 +0000</pubDate>
        <link>http://katrina.im/2013/09/15/Automatic-adjustment-on-color-scheme/</link>
        <guid isPermaLink="true">http://katrina.im/2013/09/15/Automatic-adjustment-on-color-scheme/</guid>
        
        
      </item>
    
      <item>
        <title>First blog on my own place~</title>
        <description>&lt;p&gt;I bought this domain for a whole year…Between miaowu.so and awu.so, I choose this one for building a pet social network or a food searching website. &lt;strong&gt;How brilliant I am!!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And finally decide to use awu.so to build &lt;strong&gt;my own blog&lt;/strong&gt;=v=……….&lt;/p&gt;

&lt;p&gt;It is not fun as I thought…But at least I don’t waste it anymore.&lt;/p&gt;

&lt;p&gt;I haven’t write some public blogs for 4 years…So it’s kind of a big step for me.&lt;/p&gt;

&lt;p&gt;I will write something about my work, my life, my drawings, my questions on this website.&lt;/p&gt;
</description>
        <pubDate>Sat, 31 Aug 2013 15:44:23 +0000</pubDate>
        <link>http://katrina.im/2013/08/31/First-blog-on-my-own-place~/</link>
        <guid isPermaLink="true">http://katrina.im/2013/08/31/First-blog-on-my-own-place~/</guid>
        
        
      </item>
    
  </channel>
</rss>
