摘要://计算角度float CMgrSkill::getAngle( CCPoint & frome, CCPoint & to ){ double len_y = to.y - frome.y; double len_x = to.x - frome.x; if( 0 == len_x && f...
阅读全文
摘要:创建型1. Factory Method(工厂方法)2. Abstract Factory(抽象工厂)3. Builder(建造者)4. Prototype(原型)5. Singleton(单例)结构型6. Adapter Class/Object(适配器)7. Bridge(桥接)8. Compo...
阅读全文
摘要:// Pass the touches to the superview#pragma mark EAGLView - Touch Delegate- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ if (isKey...
阅读全文
摘要:-(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox{ self = [super init]; do { if (self == nil) break; editSta...
阅读全文
摘要:1.CCClippingNode在部分android上不起作用需要修改src\org\cocos2dx\lib\Cocos2dxGLSurfaceView.java//frompublic Cocos2dxGLSurfaceView onCreateView() { return new Coco...
阅读全文
摘要:staticvoid TEACore(unsignedint in[2], unsignedint out[2], unsignedint key[4], long rounds){unsigned int y = in[0], z = in[1];unsigned int limit = 0, s...
阅读全文
摘要:ios//// movieplayercontroller.h// sgcard//// Created by Apple on 13-9-10.////#import #import "movieplayer.h"#import "EAGLView.h"@interface MoviePlayer...
阅读全文
摘要://// ThreadLoadPVR.h// sgcard//// Created by Apple on 13-9-24.////#ifndef __sgcard__MgrLoadPVR__#define __sgcard__MgrLoadPVR__#include "Uncopyable.h"#...
阅读全文
摘要:void * CNetThread::getIpAddress(void *arg){ //将原先的会引发线程不安全的代码更改为线程安全的代码 CServerInfo *info = static_cast(arg); // CServerInfo info; // GameInfo::...
阅读全文
摘要:int setNickLayer::countNum(const char * inText, int &outNum1, int &outNum2){ outNum1 = 0; outNum2 = 0; const char *p = inText; while(*p) { uns...
阅读全文
摘要:黑米:http://www.himigame.com/泰然:http://www.tairan.com/
阅读全文
摘要://iosvoidProgressBar::start(){ if(nil == progress) prepare(); [progressstartProgressBar];}voidProgressBar::stop(){ [progressstopProgressBar]; p...
阅读全文
摘要:有点意思的东西,IOS下能跑起来,android不行,有空的时候改改。http://blog.csdn.net/chenee543216/article/details/9277193https://github.com/chenee/cocos2dx-swf
阅读全文
摘要:根据相关功能将中间层与网络层分成以下五个功能层:游戏逻辑层(接收用户输入,处理并反馈),服务器镜像层(查询本地数据及状态,并及时调整本地数据与服务器同步),数据管理层(统一的服务器数据镜像管理),网络事物层(处理断线重连、网络超时等事物),网络传输层(与服务器的实际连接及数据传输)。 游戏逻辑层:中...
阅读全文
摘要:import flash.display.MovieClip;import flash.events.Event;var info_separator = ",";var card_x:Number = card.x;var card_y:Number = card.y;var card_rotat...
阅读全文
摘要:iosint CIosDeviceInfo::getGameVersion(char *version){ NSBundle * bundle = [NSBundle mainBundle]; if( nil == bundle ) { return 0; } NSString* a...
阅读全文
摘要:背包附加:进入背包麻烦,背包的功能能按照所在页面进行不同的处理。背包独立:进入背包方便,从背包返回麻烦,可简化背包功能(背包只有选择功能)。页面切换:每个场景带私有数据,增加代码编写难度,个人认为com就是太复杂了,规矩太多。页面切换:根据需要一键切换到任何页面的任何位置的需求,页面切换应有同一的接...
阅读全文
摘要://CCLayer//CCTouchDelegateboolCBattleLayer::init(){ if( ! CCLayer::init() ) { return false; } this->setTouchEnabled( true ); return true;}void...
阅读全文
摘要:Premultply alpha 和 Reduce border artifacts 两个选项。
阅读全文
摘要://// FMUIWebViewBridge.h// sgcard//// Created by Apple on 13-9-10.////#import #import #import #import "FMLayerWebView.h"@interface FMUIWebViewBridge :...
阅读全文
摘要://CCSprite转成CCimage CCPoint p = oldSprite->getAnchorPoint(); oldSprite->setAnchorPoint(ccp(0,0)); CCRenderTexture *outTexture = CCRenderTexture::c...
阅读全文
摘要:下载并解压安卓SDK(带Eclipse)和NDK运行Eclipse选择菜单ADT->Preferences->Android->NDK->Browse选择之前解压的NDK目录点击OK右键Package Exploder空白处->Import->Android->Existing Android Co...
阅读全文
摘要:创建项目目录:cocos2d-x/tools/project-creator命令:./create_project.py -project path_test -package com.yiwanzu.test -language cpp拷贝:cocos2d-x/tools/lua_project_...
阅读全文