Login with your google account

1. Delegate和Event的区别?
2. Dispose, Finalizer, Destructor的区别?
3. Int[,]和int[][]的区别?
4. 静态构造函数和非静态构造函数的区别?
5. 函数中使用using和.cs文件开头使用using的区别?
6. String 和string的区别?(注意大小写)
7. String是值类型吗?例题:
 Static void test(string b)
 {
                b = ”b”;
 }
 String a = “a”;
 Test(a);
8. 单例和只用静态的区别?(非托管资源的释放与单例)
9. 假设Obj是Object class的实例, Obj.GetType() == typeof(Object) 与Obj is Object有什么不同?
10. string test = string.Empty 与 string test = "" 有什么不同?
11. ref关键字与out关键字有什么区别?
12. 带ref关键字的引用类型传值和不带ref关键字的引用类型传值有什么区别?

Tags: c#, 面试题

No Comments 2008-12-26 21:40:48 by Homyu.Shinn

1. postMessage (XDR)

多个window或者多个worker之间发送消息

2. Worker (Firefox3 b2支持)

类似Thread

3. registerProtocalHandler

能够让mailto:test@test.com这样的连接指向自己的WEB应用.

4. Native json parser and stringifier

5. querySelector Api

Tags: html5

No Comments 2008-12-13 01:22:06 by Homyu.Shinn

现在DOUFU中的碰撞测试是基于一个轮询机制,负责管理步调的类(PLAYGROUND)循环调用数组中的GameObject的步调函数,然后步调函数处理移动,得到下一个移动的坐标,将移动坐标传给负责碰撞测试的函数,询问是否可以移动。如果可以移动,则将GameObj的坐标设置为期待坐标,否则不改变。依此调用每个GameObject直到任务完成。

这样的设计有个严重的问题,就是碰撞测试执行的次数实在太多了,每个GameObject需要移动,就必须调用一次,并且碰撞测试函数将其与其他所有GameObject进行一次碰撞,这样导致随着GameObject数目N的上升,碰撞测试的调用次数将是N*(N-1),

另外一个问题是,这样的机制有可能导致游戏不太公平,因为先入数组的GameObject将获得更高的优先级别抢占指定的位置。

那么怎么可以减少碰撞的次数和解决上述问题呢?上次优化中已经考虑过这个问题,但是没有考虑到点子上,通过增大步长和只判断前方物体来减少运算量,这样的做法虽然可行但效果不明显。

经过在拉屎时候的思考,决定把机制改一改,使用预测机制来减少预算量,既是,每个GameObject先预测出可能移动的坐标,由碰撞测试程序进行一次性测试,最后把结果返回给各个对象,这样一来,由于进行计算时的坐标已经是预期坐标,不存在优先权问题,同时也大大减少了预算量,降低运算量到N +(N-1)+(N -2)。。。+ M (M > 1)。

同时还可以结合脏记录法,标记出没有移动过的物体,只计算移动过的GameObject。进一步降低运算量。

Tags: doufu

No Comments 2008-12-10 01:12:09 by Homyu.Shinn

I would like you share with you a interesting bug of IE, which was found when I am writing my own JSON implementation.


Only 20 lines javascript code cause IE 6 and IE 7 browser crash!


////////////Code start

callback = function(data)
{
 alert(data.Movements);
 document.body.removeChild(scriptNode);

}

 

loop = function()
{
 scriptNode = document.createElement("script");
 scriptNode.type = "text/javascript"
 scriptNode.src = "./crashie7.js";  //The crashie7.js file should contained a call to callback() function with json data)
 document.body.appendChild(scriptNode);


 setTimeout(loop, 700);
}


loop();
////////////Code End

 

It seems remove a script node while codes in it were executing will cause IE browser crash.


I also found a quick fix for that problem:


////////////Code start
callback = function(data)
{
 alert(data.Movements);


       //  A delay to remove the script node.
 setTimeout(function()
 {
  document.body.removeChild(scriptNode);
 }, 3000);
}
////////////Code End

 

 

Running above piece on you IE browser and have crash fun!

Tags: crash, javascript, ie

No Comments 2008-11-04 13:24:58 by Homyu.Shinn

I don't like to be obligated to open source my server side project of doufu sample game, though it is just a 'prove of concept'.

So rather than GoogleCode, I decided to use Beanstalk (http://www.beanstalkapp.com/) which is a cool svn hoster allow me to use 20mb svn space without charge, and it also allowe me to integrate my project with the other web2.0 service, such as twitter or basecamp.

Tags: svn, doufu server

No Comments 2008-10-06 13:54:24 by Homyu.Shinn

1. 没有属性构造器.

2. this不仅仅指当前对象,还有多重意思,居然还可以指父类构造函数或直接指父类.

3. super不是变量, 只是一个keyword

4. 没有严格区分override 和hide, 属性就叫hide,方法就叫override

5. 成员对象不加modifier时会自动隐藏,也就是private的访问范围.
    而"属性"不加modifier时会自动public?
    这也tm太混乱了吧?

其他还好,第二点觉得真是晕.没C#中来得严谨.

http://www.javaeye.com/topic/15400

Tags: java

No Comments 2008-09-27 11:50:59 by Homyu.Shinn

http://fordana.com/

The graphics is suck, however the game play and gaming experience is relatively good since it is a javascript based mmo rpg.

The game didn't use ajax for transfering data between client and server. So player may feel a little bit laggy and the character moving can be more smooth if more client side optimizations were made.

I was called norm in that game. meet you there!

http://www.margonem.pl/

A polish ajax mmo rpg which offered a great graphics and smooth sprite movement. however, the collision detection is still cell-based, and due to the game engine, you cannot hide the sprite behind any other object such as houses and trees.

This game is apparently more playable than the first one. But what sad is I cannot read polish...

http://www.vanthia.com/

I don't have much information about this project, it is still under development. Seem to be open beta next month and I heard that the developer is now wasting his time on war hammer's new online game.

Update 10/7: hmmm.. I just found the test server from google
http://nea.prohosting.com.pl/game/
Account: test Password: test

Tags: mmorpg

No Comments 2008-09-26 12:07:02 by Homyu.Shinn

占位以后写

主要是理解

1. 任何对象都可以用来作为hastable使用.

2. hashtable的key接受任何类型.

3. 但不意味着任何类型都可以作为key,事实上 hashtable的key的类型只有string型, 接受的其他类型最终会被转换为string. 

 

 

No Comments 2008-09-25 04:41:30 by Homyu.Shinn

 

记录一下需要做的事情,免得过后忘了.

1. EventTrigger 只需要根据x y来判断是否触发,而不要使用rectangle collision.减少计算量 (half done, 有bug, 任何sprite移出触发范围都会导致reactivate)

2. Camera要支持 smooth scroll (done)

3. Polygon collsion要加上一个移动向量,避免不必要的多边行碰撞测试. (done,改用了direction)

4. RPG游戏中,角色与地图polygon做collsion时,角色不要用rectangle,改用点. 点取rectangle中心. (done)

5. 强类型BUFFER类

6. 改进移动,每次1PX.但是collision 提前.减少collsion的计算次数.

 

Tags: doufu

No Comments 2008-09-20 15:38:57 by Homyu.Shinn

Using FSUtil rathar than FileStream, that utility helps chock up you 80 Giga bytes disk space within 1 sec.

Link: GarbageGenerator.cs

No Comments 2008-09-05 18:31:30 by Homyu.Shinn