<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Allin's blog]]></title><description><![CDATA[power]]></description><link>https://blog.csdn.net/leeshaoqun</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; leeshaoqun]]></copyright><item><title><![CDATA[塔防游戏《android防御战》上线了]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6375684</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6375684</guid><author>leeshaoqun</author><pubDate>Sat, 30 Apr 2011 12:57:00 +0800</pubDate><description><![CDATA[<br /><br />这段时间一直在学习andengine，并开发了一款塔防游戏《android防御战》，<br />算是能学以致用 ：）<br />下面是对游戏的介绍，有兴趣的朋友可以下来玩玩看<br />二维码：<br />　　Android世界正遭受来自不同种族敌人的侵扰，你要借助android魔法塔的力量来设置防御设施，抵御敌人的入侵。<br />游戏采用传统的塔防玩法，包括6大场景，7种魔法塔，12个有趣的关卡。你可以购买不同类型的魔法塔，并决定他们的摆放的位置，升级顺序等.<br />7种魔法]]></description><category></category></item><item><title><![CDATA[控制游戏中物体的移动速度]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6249969</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6249969</guid><author>leeshaoqun</author><pubDate>Tue, 15 Mar 2011 10:08:00 +0800</pubDate><description><![CDATA[<br /> <br />最近在开发TD游戏中发现，游戏中移动的物体，在android模拟器和真机上差别比较大。<br />例如模拟器上FPS=10，真机上FPS=50，那么模拟器上的物体移动速度就会很慢，而真机上却跑得很快。<br />怎样才能让物体的移动速度不受机器性能的影响呢？其实也比较简单，只要给物体一个移动速度（带方向），然后记录上一帧和当前帧的时间间隔，乘0.001换算成秒。<br />移动速度 * 时间间隔 ，就得出每帧物体需要移动的距离。这样在性能较好的机器上，每帧的时间间隔会比较短，在同样]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法10-18]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227810</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227810</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 22:45:00 +0800</pubDate><description><![CDATA[<br /> <br />1.标量<br />标量只有大小没有方向。<br />2.矢量<br />矢量既有大小又有方向。<br />3.常用举例：<br />物理上常用的矢量与标量的对应概念有:速度和速率；距离和位移等。如图：<br /><br />距离：<br />假设A到B的距离为a，B到C的距离为b，C到D的距离为c；<br />那么A到D的距离就为a+b+c。<br />位移：<br />假设A到B的位移为a，B到C的位移为b，C到D的位移为c；<br />那么A到D的位移大小为|a+b+c|（数]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（9）：三角代数]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227651</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227651</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:20:00 +0800</pubDate><description><![CDATA[<br /><br />三角代数里的公式推理思路都是通过单位圆来完成的。<br />在单位圆中有x2+y2=1。下图为一单位圆：<br /><br />推论出的公式：<br />cos2a + sin2a = 1<br />sin(–a) = –sina<br />cos(–a) = cosa<br />tan(–a) = –tana<br /><br />sin(a1 + a2) = sina1cosa2 + cosa1sina2<br />sin(a1 – a2) = sina1cosa2 – cosa]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（8）：三角函数]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227649</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227649</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:19:00 +0800</pubDate><description><![CDATA[<br /><br />三角函数在计算机游戏开发中是经常被用到的。<br /><br />主要三角函数<br />sin a=b/c<br />cos a=a/c<br />tan a=b/a<br />其他三角函数<br />csc a=c/b=1/ sin a<br />sec a=c/a=1/ cos a<br />cot a=a/b=1/ tan a<br />                     常用三角函数函数值表<br />a (Degrees)<br />a (Radians)<br /]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（7）：角度 vs 弧度]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227648</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227648</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:18:00 +0800</pubDate><description><![CDATA[<br />我们通常使用的笛卡尔坐标系统，角点通常在(0,0),即原点。初始边在x轴正半轴，终边与初始边成夹角。<br />初始边逆时针旋转为正值，顺时针旋转为逆值。<br />              <br /><br />数学表示：<br />角度：degree=radian*180/π<br />弧度：radian=degree*π/180<br />π≈3.141592654<br />例如：120◦转换为弧度为2π/3<br />计算机中的实现：<br />#define RadToDeg 5]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（6）：圆和球的碰撞检测]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227647</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227647</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:17:00 +0800</pubDate><description><![CDATA[<br /> <br />1.圆的碰撞检测<br />圆的碰撞条件：<br />当两个圆相切或者相交时，我们认为两个圆应该开始发生碰撞。<br /><br /><br />数学表示：<br /><br />计算机中的实现：<br />bool CollisionBetweenCircles(circle c1,circle c2)
{
    bool hit;
    float distanceOfCenter=sqrt(pow((c1.center.x-c2.center.x),2)+
   ]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（5）：圆（2D）和球（3D）]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227641</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227641</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:16:00 +0800</pubDate><description><![CDATA[<br /> <br />1.圆（2D）<br />圆的两个关键因素：圆心和半径。<br />公式：<br />(x–h)2 + (y–k)2 = r2  圆心为(h,k)  半径为r.<br /><br />举例：圆心为(1,2),半径为2的圆。<br /><br /><br />计算机中的实现：<br />struct circle
{
    Point2D center;
    float radius;
} <br /><br />2.球（3D）<br />球的两个关键因素：球心和半径。]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（4）：抛物线]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227636</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227636</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:13:00 +0800</pubDate><description><![CDATA[<br /><br />抛物线<br />如果你投掷一个铅球或者踢足球，它们将做一个抛物线运动。因为它们总是受一个垂直于地面的重力加速度g的作用。下图为四个方向上的抛物线。<br /><br /><br />公式：<br />垂直轴向上的抛物线：y=a(x–h)2+k, 顶点为(h,k),关于x=h对称.<br />水平轴向上的抛物线：x=a(y–k)2+h, 顶点为(h,k),关于y=k对称.<br />举例：<br />  ]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（3）：点之间的距离]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227630</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227630</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:12:00 +0800</pubDate><description><![CDATA[<br /> <br />1.计算两点之间的距离<br />公式：a2+b2=c2（勾股定理）<br />        <br />2D:<br /><br />3D:<br /><br />计算机实现：<br />float Distance2D(Point2D p1,Point2D p2)
{
    float dx=p1.x-p2.x;
    float dy=p1.y-p2.y;
    float distance=sqrt(pow(dx,2)+pow(dy,2));
    re]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（2）]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227622</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227622</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:08:00 +0800</pubDate><description><![CDATA[<br /> <br />直线公式：<br />Ax + By = C  （A和B不能同时为0）<br />讨论：<br />A和B不为0：为斜线（不垂直于x轴和y轴）;<br />A为0，B不为0：直线为垂直于y轴的直线，且于y轴交与点(0,C/B);<br />A不为0，B为0：直线为垂直于x轴的直线，且于x轴交与点(C/A,0);<br />例1：<br /><br />例2：<br /><br />斜率：<br /><br />定义斜率：<br />float GetSlope(Point2D p1]]></description><category></category></item><item><title><![CDATA[游戏开发中的数学和物理算法（1）：定义点]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6227617</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6227617</guid><author>leeshaoqun</author><pubDate>Sun, 06 Mar 2011 21:06:00 +0800</pubDate><description><![CDATA[<br /> <br />数学中的坐标系统（笛卡尔坐标系统）<br /><br />这里A(0,0), B(1,2), C(4,3), D(–1,2), E(–2,–1), F(3,–2).<br />计算机中的坐标系统（屏幕坐标系统）<br /><br />注意这里的y轴在两个坐标系统是相反的。在后面将会研究将笛卡尔坐标系统转换为屏幕坐标系统。<br />在3D的坐标系中，没有一个工业标准，有的采用y轴向上（y-up）的坐标系，有的采用z轴向上（z-up）的坐标系，有的采用右手坐标系统（right-han]]></description><category></category></item><item><title><![CDATA[控制游戏中物体的移动速度]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6210680</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6210680</guid><author>leeshaoqun</author><pubDate>Sun, 27 Feb 2011 00:22:00 +0800</pubDate><description><![CDATA[<br /> <br />最近在开发TD游戏中发现，游戏中移动的物体，在android模拟器和真机上差别比较大。<br />例如模拟器上FPS=10，真机上FPS=50，那么模拟器上的物体移动速度就会很慢，而真机上却跑得很快。<br />怎样才能让物体的移动速度不受机器性能的影响呢？其实也比较简单，只要给物体一个移动速度（带方向），然后记录上一帧和当前帧的时间间隔，乘0.001换算成秒。<br />移动速度 * 时间间隔 ，就得出每帧物体需要移动的距离。这样在性能较好的机器上，每帧的时间间隔会比较短，在同样]]></description><category></category></item><item><title><![CDATA[制作Java Applet签名验证]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/6078974</link><guid>https://blog.csdn.net/leeshaoqun/article/details/6078974</guid><author>leeshaoqun</author><pubDate>Wed, 15 Dec 2010 23:56:00 +0800</pubDate><description><![CDATA[<br />(1)将java小程序打jar cvf test.jar test.class<br /><br />(2)生成名为allin.store的密钥库,别名为allin<br />keytool -genkey -keystore allin.store -alias allin<br /><br />(3)导出chinani.cer数字证书<br />keytool -export -keystore allin.store -alias allin -file allin.cer<br /><b]]></description><category></category></item><item><title><![CDATA[完成了第一个android游戏《趣味象棋》]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/5873975</link><guid>https://blog.csdn.net/leeshaoqun/article/details/5873975</guid><author>leeshaoqun</author><pubDate>Thu, 09 Sep 2010 17:46:00 +0800</pubDate><description><![CDATA[<br />游戏中用了一个Activity主框架，在进入不同场景时再去调用不同的surfaceview<br />在整个游戏的开发过程中发现AI的设计是最难的，看来要加强算法的学习啊。<br />美工也是比较头痛的问题，图片都是用ps平平凑凑做出了的。不多说了，上截图<br /><br /><br /><br />【趣味象棋apk下载
】]]></description><category></category></item><item><title><![CDATA[我的第一个android应用 --《段子》]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/5870018</link><guid>https://blog.csdn.net/leeshaoqun/article/details/5870018</guid><author>leeshaoqun</author><pubDate>Wed, 08 Sep 2010 09:35:00 +0800</pubDate><description><![CDATA[<br />学习android也有一段时间了，不过总觉得学得比较零碎，所以决定做个应用，把学到的知识做下整理。<br />我给这个应用取名《段子》，其实就是使用httpclient从网络上下载一些比较经典的段子，然后放到本地的数据库中，这是最主要的功能。<br />当然也做了一些细化的功能，如可以对喜欢段子进行加星收藏，不喜欢的段子进行删除。同时还提供了搜索功能，方便你快速查找段子。<br />最后使用的短信的intent，方便把段子和你好友分享。 <br />功能就这么多，下面有截图和apk包下载：<br]]></description><category></category></item><item><title><![CDATA[HTML5 WebSockets ]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/5806670</link><guid>https://blog.csdn.net/leeshaoqun/article/details/5806670</guid><author>leeshaoqun</author><pubDate>Thu, 12 Aug 2010 13:22:00 +0800</pubDate><description><![CDATA[HTML5之中一个很酷的新特性就是WebSockets，它可以让我们无需AJAX请求即可与服务器端对话。今天彬Go将让大家通过Php环境的服务器端运行WebSocket，创建客户端并通过WebSockets协议发送和接收服务器端信息。

 

什么是WebSockets？

　　WebSockets是在一个(TCP)接口进行双向通信的技术，PUSH技术类型。同时WebSockets仍将基于W3C标准，目前为止，Chrome和Safari的最新版本浏览器已经支持WebSockets了。
WebS]]></description><category></category></item><item><title><![CDATA[android blog]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/5561577</link><guid>https://blog.csdn.net/leeshaoqun/article/details/5561577</guid><author>leeshaoqun</author><pubDate>Thu, 06 May 2010 00:59:00 +0800</pubDate><description><![CDATA[开通了新的博客，用来搜集和整理android学习开发中的点点滴滴 http://allin.cnblogs.com/]]></description><category></category></item><item><title><![CDATA[深入理解JAVA事件机制]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/5497251</link><guid>https://blog.csdn.net/leeshaoqun/article/details/5497251</guid><author>leeshaoqun</author><pubDate>Sat, 17 Apr 2010 18:17:00 +0800</pubDate><description><![CDATA[ java中的事件机制的参与者有3种角色：1.event object：事件状态对象，用于listener的相应的方法之中，作为参数，一般存在与listerner的方法之中2.event source：具体的事件源，比如说，你点击一个button，那么button就是event source，要想使button对某些事件进行响应，你就需要注册特定的listener。3.event ]]></description><category></category></item><item><title><![CDATA[js表单验证]]></title><link>https://blog.csdn.net/leeshaoqun/article/details/4784731</link><guid>https://blog.csdn.net/leeshaoqun/article/details/4784731</guid><author>leeshaoqun</author><pubDate>Sun, 08 Nov 2009 00:46:00 +0800</pubDate><description><![CDATA[ 最近公司项目中用了一些ajax的应用，其中的有些表单需要验证，周末抽空写了个通用的控件，能实现比较简单的校验，基本能满足公司项目的需求。    首先需要jquery支持，  控件支持 integer,float,munber(integer+flaot),empty String 等类型的验证。    表单控件的id和class属性是必须的  class : validata_i]]></description><category></category></item></channel></rss>