• Reflections on My First Game

    Hmm..Here is the thing…I made a game recently.

    And I put it on http://awu.so/Journey/.

    The whole process is super exciting for me.

    I enjoyed every second when I play with it.

    But…

    it turns out not as good as I expected.

    So I finally stop refining it and start to reflect on the whole thing.

    The basic game flow was completed.

    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

    The first problem is that, there is two game system in the game: the trade system and the fight system.

    The trade system is that goods types and prices varies, so you can speculate on them.

    The fight system is quite tricky game.

    Both these two parts can be a single game. Now they are distracting.

    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.

    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.

    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.

    I made a dream this afternoon =w=..it’s kind of a nightmare, but can be a good game.

    In the next step, I will take some time to prepare on the new game.

    BTW, if you see this post and play the game - Journey. Pls kindly leave some comments to me. My Email

  • Js Scope and Scope Chain

    I found such a problem when I played with cocos2d-js:

    for (var i in goods_today) {
    	var cur_good = goods_today[i];
    	var good_label = cc.LabelTTF.create(goods_name[cur_good] + ":"
    		+ prices_today[i], "Arial", 20);
    	var good_item = cc.MenuItemLabel.create(good_label,
    		function() {this.buyIn(cur_good);}, that);
    	market_list.addChild(good_item);
    }

    It turned out that every MenuItemLabel got the last value of cur_good for its parameter for buyIn.

    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).

    To explain the problem, there are two principles should be explained first.

    1.Scope

    {}, if(){}, for(){}

    does not mean a scope in javascript, only function(){} give us a scope. e.g.

    var name="global";  
    if(true){  
        var name="local";  
        alert(name);
    }  
    alert(name);

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

    So for (var i in goods_today){} equals to var i; for (i in goods_today)

    2.Scope Chain

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

    var name = "Scope1";
    function a() {
    	var name = "Scope2";
    	function b() {
    		var name = "Scope3";
    		alert(name);
    	}
    	function c() {
    		alert(name);
    	}
    	b();	//-->"Scope3"
    	c();	//-->"Scope2"
    }
    a();

    That explains why I got 4 “buyIn(3)”

    So I need to put these codes into a function to create a scope:

    for (var i in goods_today) {
    	(function(that, good){
    		var cur_good = goods_today[good];
    		var good_label = cc.LabelTTF.create(goods_name[cur_good] + ":"
    			+ prices_today[idx], "Arial", 20);
    		var good_item = cc.MenuItemLabel.create(good_label,
    			function() {this.buyIn(cur_good);}, that);
    		market_list.addChild(good_item);
    	})(this, i)
    }

    Now it works well~

  • Sketchs

    Recent sketchs

    HOBO cat feather

  • Evaluation on Images

    I implement an interesting tool to calculate the harmony of pictures.

    It is based on the algorithm described in former post

    It can used to compare two similar pictures,

    e.g.

    1. Two color scheme for the webpage you created

    2. A photo before & after adjustment

    There is little meaning for compare the score for two absolutely different picture.

    Ok, let have a look at the demo evaluation page.

    Lower score indicates better performance.

    Evaluation Page for Picture’s Harmony Score!

    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.

    But

    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.

    2.The most harmony ones are not necessary the attractive ones. Some ugly ones might got more attention.

    It remind me of the following joke…

    Joke

  • Experiments on Color Harmony Evaluation and Adjustment

    Part I: Color harmony evaluation

    I evaluate two-color harmony with the theory and made a evaluation page.

    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”.

    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.

    Evaluated colors are selected from some existing web pages.

    ColorHarmonyEvaluationPage

1 2 Next Page


subscribe via RSS