11 2014 档案

摘要:在不使用物理引擎的情况下,模拟物体在重力作用下的抛物线运动(忽略空气阻力)。给出运动起始点位置,终点位置,重力加速度g,起始点的发射角作为参数。 先根据已知条件求出物体在x轴和y轴上的初速度,再根据公式f(t)=v0t+0.5*at2 求出运动轨迹。 类CCParabolaMove继承自C... 阅读全文
posted @ 2014-11-30 20:46 Reise 阅读(2099) 评论(0) 推荐(0)
摘要:改变锚点时,同过计算偏移量修正position从而保持CCNode在屏幕上的位置不变 1 void CLayer::change_anchorpoint(CCNode* node,CCPoint newpt) 2 { 3 float dx, dy, diffx, diffy, height,... 阅读全文
posted @ 2014-11-27 20:04 Reise 阅读(743) 评论(0) 推荐(0)