├── .cocos-project.json ├── .gitignore ├── CMakeLists.txt ├── Classes ├── AppDelegate.cpp ├── AppDelegate.h ├── GameInterface │ ├── GameInterfaceScene.cpp │ ├── GameInterfaceScene.h │ ├── LogoScene.cpp │ ├── LogoScene.h │ ├── ResourceLoadScene.cpp │ └── ResourceLoadScene.h ├── NetWorkGame │ ├── ConnectServer │ │ ├── ConnectServerScene.cpp │ │ └── ConnectServerScene.h │ ├── NetworkBase │ │ ├── Connect.cpp │ │ ├── Connect.h │ │ ├── NetworkBaseScene.cpp │ │ └── NetworkBaseScene.h │ ├── NetworkGame │ │ ├── NetworkGameOverScene.cpp │ │ ├── NetworkGameOverScene.h │ │ ├── NetworkGameScene.cpp │ │ ├── NetworkGameScene.h │ │ ├── SelectRoleScene.cpp │ │ ├── SelectRoleScene.h │ │ ├── WaitingNetworkGameScene.cpp │ │ └── WaitingNetworkGameScene.h │ ├── SelectRooms │ │ ├── CreateRoomScene.cpp │ │ ├── CreateRoomScene.h │ │ ├── GetRoomsScene.cpp │ │ ├── GetRoomsScene.h │ │ ├── JoinRoomScene.cpp │ │ ├── JoinRoomScene.h │ │ ├── RoomsInfo.cpp │ │ └── RoomsInfo.h │ ├── SignIn │ │ ├── SignInScene.cpp │ │ └── SignInScene.h │ └── SignUp │ │ ├── SignUpScene.cpp │ │ └── SignUpScene.h ├── QE.h ├── QuickEngine │ ├── QAnimate.cpp │ ├── QAnimate.h │ ├── QDesignMode.h │ ├── QEditBox.cpp │ ├── QEditBox.h │ ├── QFileUtils.h │ ├── QJson.cpp │ ├── QJson.h │ ├── QLayer.h │ ├── QMenu.cpp │ ├── QMenu.h │ ├── QMessageBox.cpp │ ├── QMessageBox.h │ ├── QObject.cpp │ ├── QObject.h │ ├── QScene.cpp │ ├── QScene.h │ ├── QSprite.cpp │ ├── QSprite.h │ ├── QString.cpp │ ├── QString.h │ ├── QTMX.cpp │ ├── QTMX.h │ ├── QType.h │ └── QuickEngine.h ├── SingleGame │ ├── Battle.cpp │ ├── Battle.h │ ├── DataParse.cpp │ ├── DataParse.h │ ├── HRocker.cpp │ ├── HRocker.h │ ├── MapFive.cpp │ ├── MapFive.h │ ├── MapFour.cpp │ ├── MapFour.h │ ├── MapOne.cpp │ ├── MapOne.h │ ├── MapThere.cpp │ ├── MapThere.h │ ├── MapTwo.cpp │ ├── MapTwo.h │ ├── animation.cpp │ └── animation.h └── Test │ ├── HelloWorldScene.cpp │ ├── HelloWorldScene.h │ ├── HttpTest.cpp │ ├── HttpTest.h │ ├── PopAlertDialog.cpp │ ├── PopAlertDialog.h │ ├── SignInSceneTest.cpp │ ├── SignInSceneTest.h │ ├── SocketIOTestLayer.cpp │ ├── SocketIOTestLayer.h │ ├── WebSocketTestLayer.cpp │ └── WebSocketTestLayer.h ├── LICENSE ├── ReadMe.md ├── Resources ├── 0%.png ├── 0.png ├── 100.png ├── 124.png ├── 2123.png ├── BackGround.png ├── Cillidable.png ├── ConnectServerScene │ ├── bg.png │ └── editBox.png ├── CreateRoomScene │ ├── bg.png │ ├── confirm.png │ ├── editBox.png │ ├── editBoxPressed.png │ └── final.png ├── Data.json ├── GameInterfaceScene │ ├── beginGame.png │ ├── beginNetworkGame.png │ ├── bg.png │ ├── quit.png │ └── setting.png ├── GetRoomsScene │ ├── bg.png │ ├── checkbutton.png │ ├── createbutton.png │ ├── joinbutton.png │ ├── roomcard.png │ └── roomcardbg.png ├── HOSP.png ├── JoinRoomScene │ ├── bg.png │ ├── confirm.png │ ├── editBox.png │ └── editBoxPressed.png ├── MapTwo.tmx ├── Nbutton.png ├── Nbutton1.png ├── NetworkGameOverScene │ ├── babyLose.png │ ├── back.png │ ├── refereeLose.png │ └── scoundrelLose.png ├── NetworkGameScene │ ├── baby'sTurn.png │ ├── baby.png │ ├── babyPP.png │ ├── babyWin.png │ ├── back.png │ ├── bg.png │ ├── chat.png │ ├── chatBg.png │ ├── confirm - 副本.png │ ├── confirm.png │ ├── editBox.png │ ├── editBoxPressed.png │ ├── goOn.png │ ├── no.png │ ├── referee'sTurn.png │ ├── referee.png │ ├── refereeConfirm - 副本.png │ ├── refereeConfirm.png │ ├── refereePP.png │ ├── scoundrel'sTurn.png │ ├── scoundrel.png │ ├── scoundrelPP.png │ ├── scoundrelWin.png │ ├── send.png │ ├── sendPressed.png │ └── yes.png ├── SelectRoleScene │ ├── baby.png │ ├── back.png │ ├── bar.png │ ├── bg.png │ ├── confirm.png │ ├── confirmPressed.png │ ├── radioOff.png │ ├── radioOn.png │ ├── referee.png │ └── scoundrel.png ├── SignInScene │ ├── bg.png │ ├── btnBg.png │ ├── editBox.png │ └── editBoxPressed.png ├── SignUpScene │ ├── bg.png │ ├── editBox.png │ └── editBoxPressed.png ├── WaitingNetworkGameScene │ ├── back.png │ ├── bg.png │ ├── notReady.png │ └── ready.png ├── Ybutton.png ├── Ybutton1.png ├── ZOO.png ├── aaa.png ├── back.png ├── backmusic.mp3 ├── backmusic1.mp3 ├── backmusic2.mp3 ├── backmusic3.mp3 ├── bghuang.png ├── bgr.png ├── bird1.png ├── btn_start1.png ├── btn_start2.png ├── buddy_1.plist ├── buddy_1.png ├── buddy_1_1.png ├── car.png ├── closeset.png ├── colidable.png ├── coliding.png ├── duihao.png ├── duihao1.png ├── duihao2.png ├── enermy_1.plist ├── enermy_1.png ├── enermy_1_1.png ├── enermy_2.plist ├── enermy_2.png ├── enermy_2_1.png ├── enermy_3.plist ├── enermy_3.png ├── enermy_3_1.png ├── enermy_4.plist ├── enermy_4.png ├── enermy_4_1.png ├── enter.png ├── flower.plist ├── hosp.tmx ├── left.png ├── loading.png ├── logo.png ├── mainMap.tmx ├── mianban.png ├── ok.png ├── out.png ├── quan.png ├── right.png ├── school.png ├── school.tmx ├── setbg.png ├── shop.png ├── shop.tmx ├── solo.png ├── solo1.png ├── solo2.png ├── text.xml ├── walk.plist ├── walk.png ├── walk_1.png ├── yaogandi.png ├── yaogandian.png ├── yuan.png └── zoo.tmx ├── Server ├── .gitignore ├── baby's 36 skills.sql ├── createRoom.js ├── db.js ├── dialog.js ├── getRooms.js ├── joinRoom.js ├── required.txt ├── selectRole.js ├── signIn.js ├── signUp.js ├── test │ ├── SocketApp.js │ ├── http_server.js │ └── ws.js ├── waiting.js └── websocketApp.js ├── buildToAndroidWithDebugMode.bat ├── buildToAndroidWithReleaseMode.bat ├── buildToWin32WithDebugMode.bat ├── buildToWin32WithReleaseMode.bat ├── openServer.bat ├── proj.android ├── .gitignore ├── app │ ├── .gitignore │ ├── AndroidManifest.xml │ ├── build.gradle │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── hellocpp │ │ │ └── main.cpp │ ├── proguard-rules.pro │ ├── res │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── org │ │ └── cocos2dx │ │ └── cpp │ │ └── AppActivity.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── proj.win32 ├── .gitignore ├── Baby_s_36_Skills.sln ├── Baby_s_36_Skills.vcxproj ├── Baby_s_36_Skills.vcxproj.filters ├── Baby_s_36_Skills.vcxproj.user ├── build-cfg.json ├── game.rc ├── main.cpp ├── main.h ├── res │ └── game.ico └── resource.h ├── runInAndroidWithReleaseMode.bat ├── 一键更新变动.bat └── 清除所有历史版本以减少仓库大小.bat /.cocos-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine_version": "cocos2d-x-3.17.2", 3 | "project_type": "cpp" 4 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | !.cocos-project.json 3 | !.gitignore 4 | !ReadMe.md 5 | !CMakeLists.txt 6 | !LICENSE 7 | !/Classes/ 8 | !/proj.android/ 9 | !/proj.win32/ 10 | !/Resources/ 11 | !/Server/ 12 | !*.bat -------------------------------------------------------------------------------- /Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | /** 7 | @brief The cocos2d Application. 8 | 9 | The reason for implement as private inheritance is to hide some interface call by Director. 10 | */ 11 | class AppDelegate : private cocos2d::Application 12 | { 13 | public: 14 | 15 | virtual void initGLContextAttrs(); 16 | 17 | /** 18 | @brief Implement Director and Scene init code here. 19 | @return true Initialize success, app continue. 20 | @return false Initialize failed, app terminate. 21 | */ 22 | virtual bool applicationDidFinishLaunching(); 23 | 24 | /** 25 | @brief The function be called when the application enter background 26 | @param the pointer of the application 27 | */ 28 | virtual void applicationDidEnterBackground(); 29 | 30 | /** 31 | @brief The function be called when the application enter foreground 32 | @param the pointer of the application 33 | */ 34 | virtual void applicationWillEnterForeground(); 35 | }; -------------------------------------------------------------------------------- /Classes/GameInterface/GameInterfaceScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class GameInterfaceScene :public Layer 7 | { 8 | public: 9 | QE_CreateSceneFromLayer_H(GameInterfaceScene); 10 | 11 | void setLayer(); 12 | void setMusic(Ref* sender); 13 | void setBack(); 14 | void setEffect(Ref* sender); 15 | void adjustVolumn(Ref * sender); 16 | //void startAnimate(); 17 | void enterMap(); 18 | void enterNet(); 19 | void end(); 20 | Menu* set; 21 | private: 22 | Sprite* setBg; 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /Classes/GameInterface/LogoScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "LogoScene.h" 4 | 5 | Scene * LogoScene::createScene() 6 | { 7 | Scene * scene = Scene::create(); 8 | Layer * layer = LogoScene::create(); 9 | scene->addChild(layer); 10 | return scene; 11 | } 12 | bool LogoScene::init() 13 | { 14 | if (!Layer::init()) 15 | { 16 | return false; 17 | } 18 | Size size = Director::getInstance()->getWinSize(); 19 | auto bg=Sprite::create("back.png"); 20 | auto scaleX = size.width/bg->getContentSize().width; 21 | auto scaleY = size.height/bg->getContentSize().height; 22 | bg->setScale(scaleX,scaleY); 23 | bg->setPosition(Vec2(size.width/2,size.height/2)); 24 | this->addChild(bg); 25 | 26 | auto yi=Sprite::create("logo.png"); 27 | yi->setPosition(480,320); 28 | yi->setScale(1); 29 | this->addChild(yi); 30 | auto call = CallFunc::create(CC_CALLBACK_0(LogoScene::startScene,this)); 31 | auto sequene = Sequence::create(JumpTo::create(1,Vec2(480,330),50,1),FadeOut::create(0.5),call,NULL); 32 | yi->runAction(sequene); 33 | return true; 34 | } 35 | void LogoScene::startScene() 36 | { 37 | Scene * scene = GameInterfaceScene::createScene(); 38 | TransitionScene * turn = TransitionFadeTR::create(1,scene); 39 | Director::getInstance()->replaceScene(turn); 40 | } -------------------------------------------------------------------------------- /Classes/GameInterface/LogoScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class LogoScene :public Layer 7 | { 8 | public: 9 | static Scene * createScene(); 10 | virtual bool init(); 11 | CREATE_FUNC(LogoScene); 12 | void startScene(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /Classes/GameInterface/ResourceLoadScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "ResourceLoadScene.h" 4 | 5 | Scene * ResourceLoadScene::createScene() 6 | { 7 | Scene * scene = Scene::create(); 8 | Layer * layer = ResourceLoadScene::create(); 9 | scene->addChild(layer); 10 | return scene; 11 | } 12 | bool ResourceLoadScene::init() 13 | { 14 | //初始化父类的构造函数,是的话就操作,否的话就return false 15 | if (!Layer::init()) 16 | { 17 | return false; 18 | } 19 | 20 | Size size = Director::getInstance()->getWinSize();//获取屏幕的大小 21 | Sprite * bg = Sprite::create("bgr.png");//背景 22 | //让背景图片与屏幕适配 23 | //auto与id的区别:auto是智能指针,可以自动识别后面参数的类型 24 | auto scaleX = size.width/bg->getContentSize().width; 25 | auto scaleY = size.height/bg->getContentSize().height; 26 | bg->setScale(scaleX,scaleY);//缩放 27 | bg->setPosition(Vec2(size.width/2,size.height/2));//设置位置 28 | this->addChild(bg);//添加父试图 29 | 30 | 31 | auto *ditu = Sprite::create("0%.png"); 32 | ditu->setPosition(Vec2(size.width / 2, size.height / 2-100)); 33 | this->addChild(ditu); 34 | 35 | 36 | Sprite * timerSp = Sprite::create("loading.png");//创建精灵 37 | ProgressTimer * timer = ProgressTimer::create(timerSp);//进度条 38 | timer->setPosition(Vec2(size.width/2,size.height/2-100));//设置位置 39 | /* 40 | setBarChangeRate(Vec2(1,0))和setMidpoint(Vec2(0,1))共同决定设置进度条的展开方向: 41 | 第一个参数为0表示水平方向没有展开效果,为1表示水平方向有展开效果; 42 | 第二个参数为0表示垂直方向没有展开效果,为1表示垂直方向有展开效果。 43 | (1,0):x轴方向从左向右展开;(0,1)从下向上展开;(0,0)没有展开效果;(1,1)从左下角向右向上展开。 44 | */ 45 | timer->setBarChangeRate(Vec2(1,0)); 46 | timer->setMidpoint(Vec2(0,1));//设置基准点(展开的从左边开始) 47 | timer->setType(ProgressTimer::Type::BAR);//设置进度条类型(条形) 48 | timer->setPercentage(0);//设置进度条百分比 当前所显示的 49 | this->addChild(timer); 50 | 51 | auto* car = Sprite::create("car.png"); 52 | car->setPosition(Vec2(50, size.height / 2-100)); 53 | this->addChild(car); 54 | auto yi = MoveTo::create(3, Vec2(850, size.height / 2-100)); 55 | car->runAction(yi); 56 | 57 | //1秒 运动到100% 58 | ProgressTo * progressTo = ProgressTo::create(3,100); 59 | auto call = CallFunc::create(CC_CALLBACK_0(ResourceLoadScene::LogoScene,this)); 60 | auto sequene = Sequence::create(progressTo,call,NULL); 61 | timer->runAction(sequene); 62 | return true; 63 | } 64 | void ResourceLoadScene::LogoScene() 65 | { 66 | //声明一个场景 67 | Scene * scene = LogoScene::createScene(); 68 | //翻页动画 69 | TransitionPageTurn * turn = TransitionPageTurn::create(1,scene,false); 70 | //替换场景 71 | Director::getInstance()->replaceScene(turn); 72 | } -------------------------------------------------------------------------------- /Classes/GameInterface/ResourceLoadScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class ResourceLoadScene : public Layer 7 | { 8 | public: 9 | static Scene * createScene();//创建场景(静态的类方法) 10 | virtual bool init();//构造函数(继承自父类,virtual虚函数) 11 | 12 | //创建layer(宏定义。里面传的参数是当前的类名) 13 | CREATE_FUNC(ResourceLoadScene); 14 | 15 | void LogoScene(); 16 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/ConnectServer/ConnectServerScene.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "QE.h" 4 | 5 | class ConnectServerScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 6 | { 7 | QE_SINGLETON_H(ConnectServerScene); 8 | QE_CreateSceneFromLayer_H(ConnectServerScene); 9 | NW_BaseScene; 10 | public: 11 | static void dealServerResponse(int statusCode); 12 | static void disConnect(); 13 | private: 14 | static EditBox* _ip1Box, * _ip2Box, * _port1Box, * _port2Box, *_ip3Box, *_port3Box, * _ip4Box, * _port4Box, * _ip5Box, * _port5Box; 15 | 16 | void initLabel(); 17 | 18 | void initMenu(); 19 | 20 | void back(); 21 | 22 | void initEditBox(); 23 | 24 | void connect(int n); 25 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkBase/NetworkBaseScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "NetworkBaseScene.h" 4 | 5 | Label* NetworkBaseScene::_label, * NetworkBaseScene::_logLabel; 6 | EditBox* NetworkBaseScene::_box; -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkBase/NetworkBaseScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine/QuickEngine.h" 5 | 6 | class NetworkBaseScene 7 | { 8 | public: 9 | //服务器返回信息相关 10 | //virtual void dealServerResponse(int statusCode) {}; 11 | 12 | protected: 13 | static Label* _logLabel; 14 | 15 | //标签相关 16 | void initLabel() {}; 17 | 18 | //菜单相关 19 | void initMenu() {}; 20 | 21 | static Label* _label; 22 | static EditBox* _box; 23 | }; 24 | 25 | #define NW_InitLogLabel(__x__, __y__) _logLabel = createLabel(Connect::getStatus(int(Connect::_nowEvent)*100 + 11)); \ 26 | _logLabel->setPosition(__x__, __y__); 27 | 28 | #define NW_BaseScene public: \ 29 | static void dealServerResponse(string str) {_logLabel->setString(str);}; \ 30 | \ 31 | private: \ 32 | Label* createLabel(string show) \ 33 | { \ 34 | _label = Label::create(show, QE_Font, 24); \ 35 | _label->setAnchorPoint(Vec2(0, 0)); \ 36 | _label->setColor(Color3B::BLACK); \ 37 | addChild(_label); \ 38 | return _label; \ 39 | }; \ 40 | \ 41 | virtual void editBoxReturn(EditBox* editBox) {}; \ 42 | \ 43 | EditBox* createEditBox(string normalPngFile, string pressedPngFile) \ 44 | { \ 45 | _box = EditBox::create(Size(220, 38), Scale9Sprite::create(normalPngFile), Scale9Sprite::create(pressedPngFile)); \ 46 | _box->setFontName(QE_Font); \ 47 | _box->setFontSize(25); \ 48 | _box->setFontColor(Color3B(0, 0, 255)); \ 49 | _box->setPlaceholderFontName(QE_Font); \ 50 | _box->setPlaceholderFontSize(25); \ 51 | _box->setPlaceholderFontColor(Color3B(255, 0, 0)); \ 52 | _box->setMaxLength(16); /*设置文本框中文本的最大长度*/ \ 53 | _box->setInputMode(EditBox::InputMode::SINGLE_LINE); /*输入键盘模式,除换行外的所有符号*/ \ 54 | _box->setReturnType(EditBox::KeyboardReturnType::DONE);/*设置软键盘中回车按钮的样子*/ \ 55 | _box->setAnchorPoint(Vec2(0, 0)); \ 56 | _box->setDelegate(this); /*开启委托,文本框代理,需要实现EditBoxDelegate代理中的方法,就可以对EditBox进行控制*/ \ 57 | addChild(_box); \ 58 | return _box; \ 59 | } \ 60 | \ 61 | EditBox* createEditBox(string file) { return createEditBox(file, file); } \ 62 | \ 63 | EditBox* createEditBox(string file, string text, int maxLength) \ 64 | { \ 65 | _box = createEditBox(file); \ 66 | _box->setText(text.c_str()); \ 67 | _box->setPlaceHolder(text.c_str()); /*当编辑框中没有任何字符(或输入字符前)的提示文本,即占位符*/ \ 68 | _box->setMaxLength(maxLength); /*设置文本框中文本的最大长度*/ \ 69 | return _box; \ 70 | } 71 | 72 | #include "QE.h" -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/NetworkGameOverScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "NetworkGameOverScene.h" 4 | 5 | string NetworkGameOverScene::_Loser = "refereeLose"; 6 | 7 | QE_SINGLETON2_CPP(NetworkGameOverScene); 8 | 9 | QE_CreateSceneFromLayer_CPP(NetworkGameOverScene); 10 | paths = { "NetworkGameOverScene" }; 11 | QE_SetResourcesSearchDir; 12 | 13 | _instance = this; 14 | initSprite(); 15 | initMenu(); 16 | return true; 17 | } 18 | 19 | void NetworkGameOverScene::initSprite(){ addChild(QSprite::createBg(_Loser + ".png")); } 20 | 21 | void NetworkGameOverScene::initMenu(){ QE_CreateLabelMenu(10, 500, "返回", NetworkGameOverScene, back); } 22 | 23 | void NetworkGameOverScene::back() { QE_ReplaceScene(GetRoomsScene); }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/NetworkGameOverScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class NetworkGameOverScene : public Layer 7 | { 8 | QE_SINGLETON_H(NetworkGameOverScene); 9 | QE_CreateSceneFromLayer_H(NetworkGameOverScene); 10 | public: 11 | static string _Loser; 12 | private: 13 | //精灵相关 14 | void initSprite(); 15 | 16 | //菜单相关 17 | void initMenu(); 18 | //菜单按钮回调函数相关 19 | void back(); 20 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/NetworkGameScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class NetworkGameScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(NetworkGameScene); 9 | QE_CreateSceneFromLayer_H(NetworkGameScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | private: 14 | //精灵 15 | static vector< Sprite*> _onSprites; 16 | static Sprite* _spr, *_confirmSpr, *_judgeSpr; 17 | void initSprits(); 18 | void createSprite(int x, int y, string identity); 19 | void setOnSprite(int index); 20 | void initConfrimSprite(); 21 | Sprite* createSprite(const string& picture); 22 | void createSprite(int x, const string& picture, const ccMenuCallback& callback); 23 | 24 | //菜单相关 25 | static Menu* _menu, * _sendMenu; 26 | void initMenu(); 27 | //菜单按钮回调函数相关 28 | void send(); 29 | void back(); 30 | 31 | //输入框相关 32 | static EditBox* _msgBox; 33 | void initEditBox(); 34 | 35 | //聊天信息相关 36 | ListView* _listView; 37 | void initListView(); 38 | void addListViewElement(const string msg, const string pic); 39 | void myTurn(bool isMyTurn = false); 40 | void endChat(); 41 | void yes(); 42 | void no(); 43 | void babyWin(); 44 | void scoundrelWin(); 45 | void goOn(); 46 | 47 | // 48 | virtual void onEnterTransitionDidFinish(); 49 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/SelectRoleScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "SelectRoleScene.h" 4 | 5 | RadioButtonGroup* SelectRoleScene::_radioButtonGroup; 6 | int SelectRoleScene::_index = 0; 7 | 8 | QE_SINGLETON2_CPP(SelectRoleScene); 9 | 10 | QE_CreateSceneFromLayer_CPP(SelectRoleScene); 11 | paths = { "fonts", "SelectRoleScene" }; 12 | QE_SetResourcesSearchDir; 13 | 14 | _instance = this; 15 | 16 | Connect::connect(Connect::Event::SelectRole); 17 | 18 | initSprits(); 19 | initLabel(); 20 | initMenu(); 21 | initRadioButton(); 22 | return true; 23 | } 24 | 25 | void SelectRoleScene::initSprits(){ 26 | QE_addBgSprite; 27 | QE_addBgSpriteWithName("baby.png"); 28 | QE_addBgSpriteWithName("referee.png"); 29 | QE_addBgSpriteWithName("scoundrel.png"); 30 | QE_addBgSpriteWithName("bar.png"); 31 | } 32 | 33 | void SelectRoleScene::dealServerResponse(int statusCode){ 34 | string status = Connect::getStatus(statusCode); 35 | dealServerResponse(status); 36 | QMessageBox(status); 37 | if (statusCode == 731) { QE_ReplaceScene(WaitingNetworkGameScene); } 38 | } 39 | 40 | void SelectRoleScene::initLabel(){ 41 | createLabel(GetRoomsScene::_name)->setPosition(340, 505); 42 | NW_InitLogLabel(10, 80); 43 | } 44 | 45 | void SelectRoleScene::initMenu(){ 46 | QE_CreateSpriteMenu2(470, 40, "confirm.png", "confirmPressed.png", SelectRoleScene, confirm); 47 | QE_CreateSpriteMenu(40, 520, "back.png", SelectRoleScene, back); 48 | } 49 | 50 | void SelectRoleScene::confirm(){ 51 | Connect::createMsg(); 52 | Connect::addMsg("type", _index); 53 | Connect::addMsg("un", QE_strToJStr(SignInScene::_un)); 54 | Connect::sendMsg(); 55 | } 56 | 57 | void SelectRoleScene::back() { QE_ReplaceScene(GetRoomsScene); }; 58 | 59 | void SelectRoleScene::initRadioButton(){ 60 | _radioButtonGroup = RadioButtonGroup::create(); 61 | addChild(_radioButtonGroup); 62 | 63 | for (int i = 0; i < 4; ++i){ 64 | RadioButton* radioButton = RadioButton::create("radioOff.png", "radioOn.png"); 65 | float posX = 270 + 120 * i; 66 | float posY = 500 - 140 * i; 67 | radioButton->setPosition(Vec2(posX, posY)); 68 | _radioButtonGroup->addRadioButton(radioButton); 69 | _radioButtonGroup->addEventListener(CC_CALLBACK_3(SelectRoleScene::onChangedRadioButtonGroup, this)); 70 | if (i == 0) { radioButton->setVisible(false); } 71 | addChild(radioButton); 72 | } 73 | } 74 | 75 | void SelectRoleScene::onChangedRadioButtonGroup(RadioButton* radioButton, int index, RadioButtonGroup::EventType type){ _index = index; } 76 | -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/SelectRoleScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class SelectRoleScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(SelectRoleScene); 9 | QE_CreateSceneFromLayer_H(SelectRoleScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | static int _index; 14 | private: 15 | //背景精灵相关 16 | void initSprits(); 17 | 18 | //标签相关 19 | void initLabel(); 20 | 21 | //菜单相关 22 | void initMenu(); 23 | //菜单按钮回调函数相关 24 | void confirm(); 25 | void back(); 26 | 27 | //选项 28 | static RadioButtonGroup* _radioButtonGroup; 29 | void initRadioButton(); 30 | void onChangedRadioButtonGroup(RadioButton* radioButton, int index, RadioButtonGroup::EventType type); 31 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/WaitingNetworkGameScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "WaitingNetworkGameScene.h" 4 | 5 | Sprite* WaitingNetworkGameScene::_sprite; 6 | vector< Sprite*> WaitingNetworkGameScene::_onSprites; 7 | 8 | QE_SINGLETON2_CPP(WaitingNetworkGameScene); 9 | 10 | QE_CreateSceneFromLayer_CPP(WaitingNetworkGameScene); 11 | paths = { "fonts", "WaitingNetworkGameScene" }; 12 | QE_SetResourcesSearchDir; 13 | 14 | _instance = this; 15 | 16 | initSprits(); 17 | initMenu(); 18 | return true; 19 | } 20 | 21 | void WaitingNetworkGameScene::dealServerResponse(int statusCode) 22 | { 23 | if (Connect::_nowEvent == 9) { return; } 24 | if (statusCode == 820) { setSpriteStatus(0, false); } 25 | else if (statusCode == 821) { setSpriteStatus(0, true); } 26 | else if (statusCode == 830) { setSpriteStatus(1, false); } 27 | else if (statusCode == 831) { setSpriteStatus(1, true); } 28 | else if (statusCode == 840) { setSpriteStatus(2, false); } 29 | else if (statusCode == 841) { setSpriteStatus(2, true); } 30 | } 31 | 32 | void WaitingNetworkGameScene::setSpriteStatus(int index, bool visible) { 33 | _onSprites[index]->setVisible(visible); 34 | if (_onSprites[0]->isVisible() && _onSprites[1]->isVisible() && _onSprites[2]->isVisible()){ QE_ReplaceScene(NetworkGameScene); } 35 | //if (_onSprites[0]->isVisible() || _onSprites[1]->isVisible() || _onSprites[2]->isVisible()) { QE_ReplaceScene(NetworkGameScene); } 36 | } 37 | 38 | void WaitingNetworkGameScene::createSprite(int x) 39 | { 40 | _sprite = QSprite::create("notReady.png", x, 50); 41 | addChild(_sprite); 42 | _sprite = QSprite::create("ready.png", x, 50); 43 | addChild(_sprite); 44 | _sprite->setVisible(false); 45 | _onSprites.push_back(_sprite); 46 | } 47 | 48 | 49 | void WaitingNetworkGameScene::initSprits() 50 | { 51 | if (_onSprites.size() > 0) { _onSprites.clear(); } 52 | QE_addBgSprite; 53 | createSprite(90); 54 | createSprite(680); 55 | createSprite(385); 56 | } 57 | 58 | void WaitingNetworkGameScene::initMenu() 59 | { 60 | QE_CreateSpriteMenu(40, 520, "back.png", WaitingNetworkGameScene, back); 61 | } 62 | 63 | void WaitingNetworkGameScene::back() { 64 | Connect::createMsg(); 65 | Connect::addMsg("quit", ""); 66 | Connect::sendMsg(); 67 | QE_ReplaceScene(JoinRoomScene); 68 | }; 69 | 70 | void WaitingNetworkGameScene::onEnterTransitionDidFinish() { 71 | Layer::onEnterTransitionDidFinish(); 72 | Connect::connect(Connect::Event::Waiting); 73 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/NetworkGame/WaitingNetworkGameScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class WaitingNetworkGameScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(WaitingNetworkGameScene); 9 | QE_CreateSceneFromLayer_H(WaitingNetworkGameScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | private: 14 | //背景精灵相关 15 | static vector< Sprite*> _onSprites; 16 | static Sprite* _sprite; 17 | void initSprits(); 18 | static void setSpriteStatus(int index, bool visible = true); 19 | void createSprite(int x); 20 | 21 | //菜单相关 22 | void initMenu(); 23 | //菜单按钮回调函数相关 24 | void back(); 25 | 26 | // 27 | virtual void onEnterTransitionDidFinish(); 28 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/CreateRoomScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "CreateRoomScene.h" 4 | 5 | EditBox* CreateRoomScene::_nameBox, * CreateRoomScene::_passwordBox; 6 | 7 | QE_SINGLETON2_CPP(CreateRoomScene); 8 | 9 | QE_CreateSceneFromLayer_CPP(CreateRoomScene); 10 | paths = { "fonts", "CreateRoomScene" }; 11 | QE_SetResourcesSearchDir; 12 | QE_addBgSprite; 13 | 14 | _instance = this; 15 | 16 | Connect::connect(Connect::Event::CreateRoom); 17 | 18 | initLabel(); 19 | initMenu(); 20 | initEditBox(); 21 | return true; 22 | } 23 | 24 | void CreateRoomScene::dealServerResponse(int statusCode) 25 | { 26 | string status = Connect::getStatus(statusCode); 27 | dealServerResponse(status); 28 | QMessageBox(status); 29 | if (statusCode == 531) { QE_ReplaceScene(SelectRoleScene); } 30 | } 31 | 32 | void CreateRoomScene::initLabel() 33 | { 34 | NW_InitLogLabel(20, 20); 35 | } 36 | 37 | void CreateRoomScene::initMenu() 38 | { 39 | QE_CreateSpriteMenu(470, 90, "confirm.png", CreateRoomScene, confirm); 40 | QE_CreateLabelMenu(10, 500, "返回", CreateRoomScene, back); 41 | } 42 | 43 | void CreateRoomScene::confirm() 44 | { 45 | GetRoomsScene::_name = _nameBox->getText(); 46 | GetRoomsScene::_creator = SignInScene::_un; 47 | Connect::createMsg(); 48 | Connect::addMsg("nm", QE_ToJStr(_nameBox->getText())); 49 | Connect::addMsg("pw", QE_ToJStr(_passwordBox->getText())); 50 | Connect::addMsg("creator", QE_strToJStr(SignInScene::_un)); 51 | Connect::sendMsg(); 52 | } 53 | 54 | void CreateRoomScene::back() { QE_ReplaceScene(GetRoomsScene); }; 55 | 56 | void CreateRoomScene::initEditBox() 57 | { 58 | //输入用户名的框 59 | Sprite* spr = Sprite::create("editBox.png"); 60 | _nameBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 61 | _box->setSize(spr->getContentSize()); 62 | _box->setPosition(Vec2(310, 285)); 63 | _box->setPlaceHolder("房间名"); //当编辑框中没有任何字符(或输入字符前)的提示文本,即占位符 64 | 65 | //输入密码的框 66 | _passwordBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 67 | _box->setSize(spr->getContentSize()); 68 | _box->setPosition(Vec2(310, 180)); 69 | _box->setPlaceHolder("房间密码"); 70 | _box->setInputFlag(EditBox::InputFlag::PASSWORD);////设置文本框显示文本的样式,输入密码标记 71 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/CreateRoomScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class CreateRoomScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(CreateRoomScene); 9 | QE_CreateSceneFromLayer_H(CreateRoomScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | private: 14 | //标签相关 15 | void initLabel(); 16 | 17 | //菜单相关 18 | void initMenu(); 19 | //菜单按钮回调函数相关 20 | void confirm(); 21 | void back(); 22 | 23 | //输入框相关 24 | static EditBox* _nameBox, * _passwordBox; 25 | void initEditBox(); 26 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/GetRoomsScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "GetRoomsScene.h" 4 | 5 | Label* GetRoomsScene::_roomName, * GetRoomsScene::_roomCreator; 6 | string GetRoomsScene::_name = "null" , GetRoomsScene::_creator = "null"; 7 | 8 | QE_SINGLETON2_CPP(GetRoomsScene); 9 | 10 | QE_CreateSceneFromLayer_CPP(GetRoomsScene); 11 | paths = {"GetRoomsScene" }; 12 | QE_SetResourcesSearchDir; 13 | QE_addBgSprite; 14 | 15 | _instance = this; 16 | 17 | initMenu(); 18 | 19 | RoomsInfo::initScrollView(this); 20 | return true; 21 | } 22 | 23 | void GetRoomsScene::dealServerResponse(int statusCode) 24 | { 25 | if (statusCode == 411){ 26 | _name = QJson::getString("nm"); 27 | _creator = QJson::getString("creator"); 28 | RoomsInfo::setRoomInfo(_name, _creator); 29 | } 30 | string status = Connect::getStatus(statusCode); 31 | dealServerResponse(status); 32 | QMessageBox(status); 33 | 34 | } 35 | 36 | void GetRoomsScene::initLabel(){ 37 | NW_InitLogLabel(300, 25); 38 | _logLabel->setColor(Color3B::WHITE); 39 | } 40 | 41 | void GetRoomsScene::initMenu() 42 | { 43 | QE_CreateSpriteMenu(710, 160, "createbutton.png", GetRoomsScene, createRoom); 44 | QE_CreateSpriteMenu(240, 160, "joinbutton.png", GetRoomsScene, joinRoom); 45 | QE_CreateLabelMenu(10, 500, "返回", GetRoomsScene, back); 46 | } 47 | 48 | void GetRoomsScene::createRoom(){ QE_ReplaceScene(CreateRoomScene); } 49 | 50 | void GetRoomsScene::joinRoom(){ QE_ReplaceScene(JoinRoomScene); } 51 | 52 | void GetRoomsScene::back() { QE_ReplaceScene(SignInScene); }; 53 | 54 | void GetRoomsScene::onEnterTransitionDidFinish(){ 55 | Layer::onEnterTransitionDidFinish(); 56 | Connect::connect(Connect::Event::GetRooms); 57 | initLabel(); 58 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/GetRoomsScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class GetRoomsScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(GetRoomsScene); 9 | QE_CreateSceneFromLayer_H(GetRoomsScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | static string _name, _creator; 14 | private: 15 | //标签相关 16 | static Label * _roomName, * _roomCreator; 17 | void initLabel(); 18 | 19 | //菜单相关 20 | void initMenu(); 21 | //菜单按钮回调函数相关 22 | void createRoom(); 23 | void joinRoom(); 24 | void back(); 25 | 26 | // 27 | virtual void onEnterTransitionDidFinish() ; 28 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/JoinRoomScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "JoinRoomScene.h" 4 | 5 | EditBox* JoinRoomScene::_nameBox, * JoinRoomScene::_passwordBox; 6 | 7 | QE_SINGLETON2_CPP(JoinRoomScene); 8 | 9 | QE_CreateSceneFromLayer_CPP(JoinRoomScene); 10 | paths = { "fonts", "JoinRoomScene" }; 11 | QE_SetResourcesSearchDir; 12 | QE_addBgSprite; 13 | 14 | _instance = this; 15 | 16 | Connect::connect(Connect::Event::JoinRoom); 17 | 18 | initLabel(); 19 | initMenu(); 20 | initEditBox(); 21 | return true; 22 | } 23 | 24 | void JoinRoomScene::dealServerResponse(int statusCode) 25 | { 26 | string status = Connect::getStatus(statusCode); 27 | dealServerResponse(status); 28 | QMessageBox(status); 29 | if (statusCode == 641) { QE_ReplaceScene(SelectRoleScene); } 30 | } 31 | 32 | void JoinRoomScene::initLabel() 33 | { 34 | NW_InitLogLabel(20, 20); 35 | } 36 | 37 | void JoinRoomScene::initMenu() 38 | { 39 | QE_CreateSpriteMenu(470, 90, "confirm.png", JoinRoomScene, confirm); 40 | QE_CreateLabelMenu(10, 500, "返回", JoinRoomScene, back); 41 | } 42 | 43 | void JoinRoomScene::confirm() 44 | { 45 | Connect::createMsg(); 46 | Connect::addMsg("nm", QE_ToJStr(_nameBox->getText())); 47 | Connect::addMsg("pw", QE_ToJStr(_passwordBox->getText())); 48 | Connect::sendMsg(); 49 | } 50 | 51 | void JoinRoomScene::back() { QE_ReplaceScene(GetRoomsScene); }; 52 | 53 | void JoinRoomScene::initEditBox() 54 | { 55 | //输入用户名的框 56 | Sprite* spr = Sprite::create("editBox.png"); 57 | _nameBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 58 | _box->setSize(spr->getContentSize()); 59 | _box->setPosition(Vec2(310, 285)); 60 | _box->setPlaceHolder("房间名"); //当编辑框中没有任何字符(或输入字符前)的提示文本,即占位符 61 | 62 | //输入密码的框 63 | _passwordBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 64 | _box->setSize(spr->getContentSize()); 65 | _box->setPosition(Vec2(310, 180)); 66 | _box->setPlaceHolder("房间密码"); 67 | _box->setInputFlag(EditBox::InputFlag::PASSWORD);////设置文本框显示文本的样式,输入密码标记 68 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/JoinRoomScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class JoinRoomScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(JoinRoomScene); 9 | QE_CreateSceneFromLayer_H(JoinRoomScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | private: 14 | //标签相关 15 | void initLabel(); 16 | 17 | //菜单相关 18 | void initMenu(); 19 | //菜单按钮回调函数相关 20 | void confirm(); 21 | void back(); 22 | 23 | //输入框相关 24 | static EditBox* _nameBox, * _passwordBox; 25 | void initEditBox(); 26 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/RoomsInfo.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "RoomsInfo.h" 4 | 5 | Label* RoomsInfo::_label; 6 | Button* RoomsInfo::_btn; 7 | int RoomsInfo::_roomNum = 0; 8 | vector RoomsInfo::_roomsName, RoomsInfo::_roomsCreator; 9 | 10 | ScrollView* RoomsInfo::initScrollView(Node* target){ 11 | _roomsName.clear(); 12 | _roomsCreator.clear(); 13 | _roomNum = 0; 14 | 15 | Size cSize = Size(800, 411); 16 | Vec2 position = Vec2(80, 240); 17 | 18 | //Scale9Sprite* s = Scale9Sprite::create("roomcardbg.png"); //设置ScrollView背景,便于查看容器大小 19 | //s->setContentSize(cSize + Size(10, 10)); 20 | //s->setPosition(position-Vec2(5,5)); 21 | //s->setAnchorPoint(Vec2(0, 0)); 22 | //target->addChild(s); 23 | 24 | 25 | ScrollView* _scrollView = ScrollView::create(); 26 | _scrollView->setContentSize(cSize);//因为图片的高度为215 27 | _scrollView->setAnchorPoint(Vec2(0, 0)); 28 | _scrollView->setPosition(position); 29 | _scrollView->setDirection(ScrollView::Direction::HORIZONTAL); 30 | _scrollView->setBounceEnabled(true); 31 | _scrollView->setInnerContainerSize(Size(260 * 9, 260)); 32 | target->addChild(_scrollView); 33 | 34 | //因为图片的高度为215,135=图片的宽度120+缝隙15 35 | _scrollView->addEventListener(bind(&RoomsInfo::scrollViewSdidScroll, placeholders::_1, placeholders::_2)); 36 | for (int i = 0; i < 9; i++) 37 | { 38 | _btn = Button::create("roomcard.png", "roomcard.png"); 39 | _btn->setScale9Enabled(true); 40 | _btn->setContentSize(Size(244, 260)); 41 | _btn->setPosition(Vec2(260 * i + 120, 130));// 215/2=107.5,75=120/2+15,加70是为了让左右边界处都留有缝隙 42 | _btn->addTouchEventListener(bind(&RoomsInfo::selectScene, placeholders::_1, placeholders::_2)); 43 | _btn->setTag(i + 1); 44 | 45 | createLabel("null", 120, 150); 46 | _roomsName.push_back(_label); 47 | createLabel("null", 120, 100); 48 | _roomsCreator.push_back(_label); 49 | createLabel("点此查看", 70, 40); 50 | _label->setColor(Color3B::WHITE); 51 | 52 | _scrollView->addChild(_btn); 53 | } 54 | return _scrollView; 55 | } 56 | 57 | void RoomsInfo::setRoomInfo(string name, string creator){ 58 | _roomsName.at(_roomNum)->setString(name); 59 | _roomsCreator.at(_roomNum++)->setString(creator); 60 | } 61 | 62 | Label* RoomsInfo::createLabel(string str, int x, int y){ 63 | _label = Label::create(str, QE_Font, 24); 64 | _label->setAnchorPoint(Vec2(0, 0)); 65 | _label->setPosition(x, y); 66 | _label->setColor(Color3B::BLACK); 67 | _btn->addChild(_label); 68 | return _label; 69 | } 70 | 71 | //scrollView滑动选项 72 | void RoomsInfo::scrollViewSdidScroll(Ref* sender, ScrollView::EventType type){ 73 | switch (type){ 74 | case ScrollView::EventType::SCROLL_TO_TOP:{ 75 | CCLOG("滑倒顶部了!"); 76 | break; 77 | } 78 | case ScrollView::EventType::SCROLL_TO_BOTTOM:{ 79 | CCLOG("滑倒底部了!"); 80 | break; 81 | } 82 | case ScrollView::EventType::SCROLL_TO_LEFT:{ 83 | CCLOG("滑倒左边了!"); 84 | break; 85 | } 86 | case ScrollView::EventType::SCROLL_TO_RIGHT:{ 87 | CCLOG("滑倒右边了!"); 88 | break; 89 | } 90 | case ScrollView::EventType::SCROLLING:{ 91 | CCLOG("正在滑动中!"); 92 | break; 93 | } 94 | case ScrollView::EventType::BOUNCE_BOTTOM:{ 95 | CCLOG("回弹到底部了!"); 96 | break; 97 | } 98 | case ScrollView::EventType::BOUNCE_LEFT:{ 99 | CCLOG("回弹到左边了!"); 100 | break; 101 | } 102 | case ScrollView::EventType::BOUNCE_TOP:{ 103 | CCLOG("回弹到顶部了!"); 104 | break; 105 | } 106 | case ScrollView::EventType::BOUNCE_RIGHT:{ 107 | CCLOG("回弹到右边了!"); 108 | break; 109 | } 110 | } 111 | } 112 | 113 | void RoomsInfo::selectScene(Ref* sender, Widget::TouchEventType type){ 114 | if (type != Widget::TouchEventType::ENDED){ return; } 115 | _btn = (Button*)sender; 116 | string text = "您选择了房间:" +_roomsName.at(_btn->getTag()-1)->getString() + "\n"; 117 | if (_roomNum < _btn->getTag()) { text += "但该房间不可选择。\n原因:该房间未创建"; } 118 | else{ text += "此房间可选择。"; } 119 | QMessageBox(text); 120 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/SelectRooms/RoomsInfo.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class RoomsInfo 7 | { 8 | public: 9 | static ScrollView* initScrollView(Node* target); 10 | static void setRoomInfo(string name, string creator); 11 | private: 12 | static Label* createLabel(string str, int x, int y); 13 | static Label* _label; 14 | static vector _roomsName, _roomsCreator; 15 | static Button* _btn; 16 | static int _roomNum; 17 | static void scrollViewSdidScroll(Ref* sender, ScrollView::EventType type); 18 | static void selectScene(Ref* sender, Widget::TouchEventType type); 19 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/SignIn/SignInScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "SignInScene.h" 4 | 5 | EditBox* SignInScene::_unBox, * SignInScene::_passwordBox; 6 | string SignInScene::_un = "null"; 7 | 8 | QE_SINGLETON2_CPP(SignInScene); 9 | 10 | QE_CreateSceneFromLayer_CPP(SignInScene); 11 | paths = { "fonts", "SignInScene" }; 12 | QE_SetResourcesSearchDir; 13 | 14 | _instance = this; 15 | 16 | Connect::connect(Connect::Event::SignIn); 17 | 18 | initSprite(); 19 | initLabel(); 20 | initMenu(); 21 | initEditBox(); 22 | return true; 23 | } 24 | 25 | void SignInScene::dealServerResponse(int statusCode) 26 | { 27 | string status = Connect::getStatus(statusCode); 28 | dealServerResponse(status); 29 | if (statusCode == 271) { QE_ReplaceScene(GetRoomsScene); } 30 | QMessageBox(status); 31 | } 32 | 33 | void SignInScene::initSprite() 34 | { 35 | QE_addBgSprite; 36 | } 37 | 38 | void SignInScene::initLabel(){ NW_InitLogLabel(150, 110); } 39 | 40 | void SignInScene::initMenu() 41 | { 42 | QE_CreateLabelMenu(380, 270, "登录", SignInScene, signIn); 43 | QE_CreateLabelMenu(530, 270, "注册", SignInScene, signUp); 44 | QE_CreateLabelMenu(10, 500, "返回", SignInScene, back); 45 | } 46 | 47 | void SignInScene::signIn() 48 | { 49 | Connect::createMsg(); 50 | _un = _unBox->getText(); 51 | Connect::addMsg("un", QE_ToJStr(_unBox->getText())); 52 | Connect::addMsg("pw", QE_ToJStr(_passwordBox->getText())); 53 | Connect::sendMsg(); 54 | } 55 | 56 | void SignInScene::signUp() { QE_ReplaceScene(SignUpScene); }; 57 | 58 | void SignInScene::back() { QE_ReplaceScene(ConnectServerScene); }; 59 | 60 | void SignInScene::initEditBox() 61 | { 62 | //输入ID的框 63 | _unBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 64 | _box->setPosition(Vec2(370, 380)); 65 | _box->setPlaceHolder("用户名"); //当编辑框中没有任何字符(或输入字符前)的提示文本,即占位符 66 | //输入密码的框 67 | _passwordBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 68 | _box->setPosition(Vec2(370, 330)); 69 | _box->setPlaceHolder("密码"); 70 | _box->setInputFlag(EditBox::InputFlag::PASSWORD);////设置文本框显示文本的样式,输入密码标记 71 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/SignIn/SignInScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class SignInScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(SignInScene); 9 | QE_CreateSceneFromLayer_H(SignInScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | static EditBox* _unBox, * _passwordBox; 14 | static string _un; 15 | private: 16 | //背景相关 17 | void initSprite(); 18 | //标签相关 19 | void initLabel(); 20 | 21 | //菜单相关 22 | void initMenu(); 23 | //菜单按钮回调函数相关 24 | void signIn(); 25 | void signUp(); 26 | void back(); 27 | 28 | //输入框相关 29 | void initEditBox(); 30 | }; -------------------------------------------------------------------------------- /Classes/NetWorkGame/SignUp/SignUpScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "SignUpScene.h" 4 | 5 | EditBox* SignUpScene::_unBox, * SignUpScene::_passwordBox; 6 | 7 | QE_SINGLETON2_CPP(SignUpScene); 8 | 9 | QE_CreateSceneFromLayer_CPP(SignUpScene); 10 | paths = { "fonts", "SignInScene" }; 11 | QE_SetResourcesSearchDir; 12 | QE_addBgSprite; 13 | 14 | _instance = this; 15 | 16 | Connect::connect(Connect::Event::SignUp); 17 | 18 | initLabel(); 19 | initMenu(); 20 | initEditBox(); 21 | return true; 22 | } 23 | 24 | void SignUpScene::dealServerResponse(int statusCode) 25 | { 26 | string status = Connect::getStatus(statusCode); 27 | dealServerResponse(status); 28 | QMessageBox(status); 29 | if (statusCode == 381) { QE_ReplaceScene(SignInScene); } 30 | } 31 | 32 | void SignUpScene::initLabel(){ NW_InitLogLabel(150, 150); } 33 | 34 | void SignUpScene::initMenu() 35 | { 36 | QE_CreateLabelMenu(450, 250, "注册", SignUpScene, signUp); 37 | QE_CreateLabelMenu(10, 500, "返回", SignUpScene, back); 38 | } 39 | 40 | void SignUpScene::signUp() 41 | { 42 | Connect::createMsg(); 43 | Connect::addMsg("un", QE_ToJStr(_unBox->getText())); 44 | Connect::addMsg("pw", QE_ToJStr(_passwordBox->getText())); 45 | Connect::sendMsg(); 46 | } 47 | 48 | void SignUpScene::back() { QE_ReplaceScene(SignInScene); }; 49 | 50 | void SignUpScene::initEditBox() 51 | { 52 | //输入用户名的框 53 | _unBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 54 | _box->setPosition(Vec2(370, 380)); 55 | _box->setPlaceHolder("用户名"); //当编辑框中没有任何字符(或输入字符前)的提示文本,即占位符 56 | 57 | //输入密码的框 58 | _passwordBox = _box = createEditBox("editBox.png", "editBoxPressed.png"); 59 | _box->setPosition(Vec2(370, 320)); 60 | _box->setPlaceHolder("密码"); 61 | _box->setInputFlag(EditBox::InputFlag::PASSWORD);////设置文本框显示文本的样式,输入密码标记 62 | } -------------------------------------------------------------------------------- /Classes/NetWorkGame/SignUp/SignUpScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class SignUpScene : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_SINGLETON_H(SignUpScene); 9 | QE_CreateSceneFromLayer_H(SignUpScene); 10 | NW_BaseScene; 11 | public: 12 | static void dealServerResponse(int statusCode); 13 | private: 14 | void enterSignInScene(float f); 15 | //标签相关 16 | void initLabel(); 17 | 18 | //菜单相关 19 | void initMenu(); 20 | //菜单按钮回调函数相关 21 | void signUp(); 22 | void back(); 23 | 24 | //输入框相关 25 | static EditBox* _unBox, * _passwordBox; 26 | void initEditBox(); 27 | }; -------------------------------------------------------------------------------- /Classes/QE.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine/QuickEngine.h" 5 | 6 | //宏 7 | 8 | //User 9 | #include "AppDelegate.h" 10 | 11 | //GameInterface 12 | #include "GameInterface/ResourceLoadScene.h" 13 | #include "GameInterface/LogoScene.h" 14 | #include "GameInterface/GameInterfaceScene.h" 15 | 16 | //SingleGame 17 | //动画 18 | #include "SingleGame/animation.h" 19 | //摇杆 20 | #include "SingleGame/HRocker.h" 21 | //实现解析数据 22 | #include "SingleGame/DataParse.h" 23 | #include "SingleGame/Battle.h" 24 | //主场景(入口) 25 | #include "SingleGame/MapOne.h" 26 | //动物园ZOO 27 | #include "SingleGame/MapTwo.h" 28 | //超市SHOOP 29 | #include "SingleGame/MapThere.h" 30 | // 医院HOSP 31 | #include "SingleGame/MapFour.h" 32 | //学校School 33 | #include "SingleGame/MapFive.h" 34 | 35 | //NetWorkGame 36 | #include "NetWorkGame/NetworkBase/Connect.h" 37 | #include "NetWorkGame/NetworkBase/NetworkBaseScene.h" 38 | #include "NetWorkGame/ConnectServer/ConnectServerScene.h" 39 | #include "NetWorkGame/SignIn/SignInScene.h" 40 | #include "NetWorkGame/SignUp/SignUpScene.h" 41 | #include "NetWorkGame/SelectRooms/RoomsInfo.h" 42 | #include "NetWorkGame/SelectRooms/GetRoomsScene.h" 43 | #include "NetWorkGame/SelectRooms/CreateRoomScene.h" 44 | #include "NetWorkGame/SelectRooms/JoinRoomScene.h" 45 | #include "NetWorkGame/NetworkGame/SelectRoleScene.h" 46 | #include "NetWorkGame/NetworkGame/WaitingNetworkGameScene.h" 47 | #include "NetWorkGame/NetworkGame/NetworkGameScene.h" 48 | #include "NetWorkGame/NetworkGame/NetworkGameOverScene.h" 49 | 50 | 51 | //test 52 | #if 1 53 | #include "Test\HelloWorldScene.h" 54 | #include "Test\SocketIOTestLayer.h" 55 | #include "Test\HttpTest.h" 56 | #include "Test\WebSocketTestLayer.h" 57 | #include "Test\SignInSceneTest.h" 58 | #endif // 1 -------------------------------------------------------------------------------- /Classes/QuickEngine/QAnimate.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QAnimate.h" 4 | 5 | int QAnimate::num; 6 | 7 | void QAnimate::initFramsNumFromPlistFile(const string& fileName) 8 | { 9 | Dictionary* dic = Dictionary::createWithContentsOfFile((fileName + ".plist").c_str()); 10 | Dictionary * frameDic = (Dictionary*)dic->objectForKey("frames"); 11 | num = frameDic->allKeys()->count(); 12 | frameDic->release(); 13 | } 14 | 15 | void QAnimate::initAnimateFromPlistFile(Animate*& animate, Sprite*& sprite, int x, int y, const string& fileName, string dirName, float scale, bool isRestoreOriginalFrame) 16 | { 17 | initFramsNumFromPlistFile(fileName); 18 | Animation* animation = Animation::create(); 19 | string fn; 20 | sprite = Sprite::create(); 21 | sprite->setPosition(x, y); 22 | sprite->setAnchorPoint(Vec2(0, 0)); 23 | for (int i = 1; i <= num; i++) 24 | { 25 | fn = dirName + fileName + "/" + fileName + to_string(i) + ".png"; 26 | animation->addSpriteFrameWithFile(fn); 27 | } 28 | animation->setDelayPerUnit(1); 29 | animation->setRestoreOriginalFrame(isRestoreOriginalFrame); 30 | animate = Animate::create(animation); 31 | } 32 | 33 | void QAnimate::createFramsPlayerFromPlistFile(const string& fileName, vector& sprites, int x, int y, Layer* layer, string dirName, float scale) 34 | { 35 | initFramsNumFromPlistFile(fileName); 36 | Sprite* s; 37 | string fn; 38 | for (int i = 1; i <= num; i++) 39 | { 40 | fn = dirName + fileName + "/" + fileName + to_string(i) + ".png"; 41 | s = Sprite::create(fn); 42 | s->setPosition(x, y); 43 | s->setScale(scale); 44 | s->setAnchorPoint(Vec2(0, 0)); 45 | layer->addChild(s); 46 | sprites.push_back(s); 47 | } 48 | playFramFromFrams(sprites); 49 | } 50 | 51 | void QAnimate::playFramFromFrams(vector& frames, int num) 52 | { 53 | if (num <= 0) 54 | { 55 | for (size_t i = 0, length = frames.size(); i < length; i++) 56 | { 57 | frames.at(i)->setVisible(false); 58 | } 59 | return; 60 | } 61 | else if (num >= frames.size()) 62 | { 63 | num = frames.size(); 64 | } 65 | //从逻辑序号转成物理序号 66 | num--; 67 | for (size_t i = 0, length=frames.size(); i < length; i++) 68 | { 69 | if (i != num) 70 | frames.at(i)->setVisible(false); 71 | else 72 | frames.at(i)->setVisible(true); 73 | } 74 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QAnimate.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速动画模块 8 | 含: 9 | 1.QAnimate类 10 | 用途:用于快速创建动画 11 | */ 12 | 13 | class QAnimate 14 | { 15 | public: 16 | static void createFramsPlayerFromPlistFile(const string& fileName, vector &sprites, int x, int y, Layer* layer, string dirName = "", float scale = 1.0f); 17 | //从所有动画帧中播放某一帧,num是需要播放的帧序号,默认情况下num为1,如果传进来的num<=0,则会隐藏所有帧,即停止动画播放,如果传进来的num>=frames.size(),则会显示最后一帧 18 | static void playFramFromFrams(vector &frames, int num = 1); 19 | static void initAnimateFromPlistFile(Animate*& animate, Sprite*& sprite, int x, int y, const string& fileName, string dirName = "", float scale = 1.0f, bool isRestoreOriginalFrame =true); 20 | private: 21 | //通过plist文件解析出来当前的动画有多少个动画帧,通过plist文件只是解析出来一个数字,这个数字是当前动画的帧数,把这个帧数保存在本类的静态成员num中 22 | static void initFramsNumFromPlistFile(const string& fileName); 23 | static int num; 24 | }; -------------------------------------------------------------------------------- /Classes/QuickEngine/QDesignMode.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | /* 5 | Quick Engine所属的快速设计模式模块 6 | 用途:使开发者可以使用用宏快速创建设计模式 7 | */ 8 | 9 | //**单例模式 10 | //*QE_SINGLETON_H与QE_SINGLETON_CPP应配合使用,缺一不可 11 | #define QE_SINGLETON_H(__TYPE__) \ 12 | private: \ 13 | static __TYPE__* _instance; \ 14 | __TYPE__() {}; \ 15 | ~__TYPE__() {}; \ 16 | \ 17 | public: \ 18 | static __TYPE__* getInstance() { return _instance; }; 19 | 20 | #define QE_SINGLETON_CPP(__TYPE__) __TYPE__* __TYPE__::_instance = new __TYPE__; 21 | #define QE_SINGLETON2_CPP(__TYPE__) __TYPE__* __TYPE__::_instance = nullptr; -------------------------------------------------------------------------------- /Classes/QuickEngine/QEditBox.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QEditBox.h" 4 | 5 | EditBox* QEditBox::createEditBox(string normalPngFile, EditBoxDelegate* delegate) 6 | { 7 | EditBox* box = EditBox::create(Size(220, 38), Scale9Sprite::create(normalPngFile), Scale9Sprite::create("wite_edit.png")); 8 | box->setFontName(QE_Font); 9 | box->setFontSize(25); 10 | box->setFontColor(Color3B(0, 0, 255)); 11 | box->setPlaceholderFontName(QE_Font); 12 | box->setPlaceholderFontSize(25); 13 | box->setPlaceholderFontColor(Color3B(255, 0, 0)); 14 | box->setMaxLength(16); //设置文本框中文本的最大长度 15 | box->setInputMode(EditBox::InputMode::SINGLE_LINE);//输入键盘模式,任何符号 16 | box->setReturnType(EditBox::KeyboardReturnType::DONE);//设置软键盘中回车按钮的样子 17 | box->setDelegate(delegate); 18 | return box; 19 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QEditBox.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | class QEditBox 7 | { 8 | //输入框相关 9 | public: 10 | static EditBox* createEditBox(string normalPngFile, EditBoxDelegate* delegate); 11 | }; -------------------------------------------------------------------------------- /Classes/QuickEngine/QFileUtils.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速文件使用模块 8 | 用途:用于快速设置资源搜索路径 9 | */ 10 | 11 | #define QE_SetResourcesSearchDir \ 12 | CCASSERT(paths.size(), "paths.size should not = 0"); \ 13 | FileUtils::getInstance()->setSearchResolutionsOrder(paths); -------------------------------------------------------------------------------- /Classes/QuickEngine/QJson.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QJson.h" 4 | 5 | JDoc QJson::_doc, QJson::_tempDoc; 6 | 7 | void QJson::initDocFromJsonFile(string fileName) 8 | { 9 | //获取Json文件所在的路径 10 | string filefullPath = FileUtils::getInstance()->fullPathForFilename(fileName); 11 | //CCLOG("fullPath=%s", filefullPath.c_str());//测试filefullPath的全路径(如D:/projects/SnailGoHome/Resources/Data.json) 12 | Data data = FileUtils::getInstance()->getDataFromFile(filefullPath); 13 | //用Data构建content 14 | string content = string((const char*)data.getBytes(), 0, data.getSize()); 15 | 16 | //用content构建document 17 | initDocWithString(content); 18 | } 19 | 20 | void QJson::initDocWithString(string content) 21 | { 22 | _doc.Parse<0>(content.c_str()); 23 | //解析错误 24 | CCASSERT(!_doc.HasParseError(), "Parsing to document failed."); 25 | } 26 | 27 | JValue& QJson::getArray(string key, JValue& value) 28 | { 29 | //确认拥有相应的值 30 | CC_ASSERT(value.HasMember(key.c_str())); 31 | 32 | //确认所捕获的值是Array类型的 33 | CC_ASSERT(value[key.c_str()].IsArray()); 34 | return value[key.c_str()]; 35 | } 36 | 37 | int QJson::getInt(string key, JValue& value) 38 | { 39 | //确认拥有相应的值 40 | CC_ASSERT(value.HasMember(key.c_str())); 41 | //确认所捕获的值是Int类型的 42 | CC_ASSERT(value[key.c_str()].IsInt()); 43 | return value[key.c_str()].GetInt(); 44 | } 45 | 46 | int QJson::getInt(string key) 47 | { 48 | // 确认拥有相应的值 49 | CC_ASSERT(_doc.HasMember(key.c_str())); 50 | //确认所捕获的值是String类型的 51 | CC_ASSERT(_doc[key.c_str()].IsInt()); 52 | //返回最终需要的值 53 | return _doc[key.c_str()].GetInt(); 54 | } 55 | 56 | string QJson::getString(string key, JValue& value) 57 | { 58 | //确认拥有相应的值 59 | CC_ASSERT(value.HasMember(key.c_str())); 60 | //确认所捕获的值是String类型的 61 | CC_ASSERT(value[key.c_str()].IsString()); 62 | //返回最终需要的值 63 | return value[key.c_str()].GetString(); 64 | } 65 | 66 | string QJson::getString(string key) 67 | { 68 | // 确认拥有相应的值 69 | CC_ASSERT(_doc.HasMember(key.c_str())); 70 | //确认所捕获的值是String类型的 71 | CC_ASSERT(_doc[key.c_str()].IsString()); 72 | //返回最终需要的值 73 | return _doc[key.c_str()].GetString(); 74 | } 75 | 76 | string QJson::getString() 77 | { 78 | StringBuffer buffer; 79 | Writerwriter(buffer); 80 | _doc.Accept(writer); 81 | return buffer.GetString(); 82 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QJson.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速Json读写模块 8 | 含: 9 | 1.QJson类 10 | 用途:用于快速读写Json数据 11 | */ 12 | 13 | #include "json/document.h" 14 | #include "json/rapidjson.h" 15 | #include "json/reader.h" 16 | #include "json/writer.h" 17 | #include "json/stringbuffer.h" 18 | 19 | using namespace rapidjson; 20 | typedef rapidjson::Value JValue; 21 | typedef JValue::StringRefType JString; 22 | typedef Document JDoc; 23 | 24 | #define QE_ToJStr(text) rapidjson::StringRef(text) 25 | #define QE_strToJStr(text) QE_ToJStr(text.c_str()) 26 | 27 | class QJson 28 | { 29 | public: 30 | static JDoc _doc, _tempDoc; 31 | 32 | static void initDocFromJsonFile(string fileName = "Data.json"); 33 | static void initDocWithString(string content); 34 | 35 | //get the array of key from value 36 | static JValue& getArray(string key, JValue& value); 37 | static int getInt(string key, JValue& value); 38 | static int getInt(string key); 39 | static string getString(string key, JValue& value); 40 | static string getString(string key); 41 | static string getString(); 42 | static void addMember(JString name, JString value) { _doc.AddMember(name, value, _doc.GetAllocator()); }; 43 | static void addMember(JString name, int value) { _doc.AddMember(name, value, _doc.GetAllocator()); }; 44 | static void emptyDoc(){ _doc.Parse<0>("{}"); } 45 | }; 46 | 47 | /* 48 | rapidjson::Value value,只是一个定义,还没有决定其数据类型,如果明确value的类型,再转成相应的格式 49 | 50 | Value的类型包括:int, double, string, bool, array, object, null 51 | 52 | RapidJson除了能够读取和修改数据,还能添加和删除数据 53 | 添加数据时,先获取一个分配器 54 | rapidjson::Document::AllocatorType &allocator = doc.GetAllocator(); 55 | 添加一个数: 56 | doc.AddMember("age", 15 , allocator); 57 | 添加一个null对象 58 | rapidjson::Value nullObject(rapidjson::kNullType); 59 | doc.AddMember("null", nullObject, allocator); 60 | 添加一个对象 61 | rapidjson::Value obj(rapidjson::kObjectType); 62 | obj.AddMember("name", "xiaoli", allocator); 63 | obj.AddMember("age", 20, allocator); 64 | obj.AddMember("height", 180, allocator); 65 | doc.AddMember("personInfo", obj, allocator); 66 | 添加一个数组 67 | rapidjson::Value arr(rapidjson::kArrayType); 68 | arr.PushBack(1, allocator); 69 | arr.PushBack("string in array", allocator); 70 | arr.PushBack(obj, allocator); 71 | doc.AddMember("arr", arr, allocator); 72 | */ -------------------------------------------------------------------------------- /Classes/QuickEngine/QLayer.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | /* 5 | Quick Engine所属快速层模块 6 | 用途:用于快速创建Layer的子类,并进行相应的初始化。 7 | */ 8 | 9 | #define QE_CreateLayerFromLayer_H(TYPE) \ 10 | public: \ 11 | CREATE_FUNC(TYPE); \ 12 | virtual bool init(); \ 13 | QE_get_winSize; 14 | 15 | #define QE_CreateLayerFromLayer_CPP(TYPE) \ 16 | bool TYPE::init() \ 17 | { \ 18 | if (!Layer::init()) \ 19 | { \ 20 | return false; \ 21 | } 22 | -------------------------------------------------------------------------------- /Classes/QuickEngine/QMenu.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QMenu.h" 4 | 5 | MenuItem* QMenu::_item; 6 | Menu* QMenu::_menu; 7 | 8 | QE_SINGLETON_CPP(QMenu) 9 | 10 | MenuItemSprite* QMenu::createMenuItemSprite(const string& picture, const ccMenuCallback& callback, int x, int y) 11 | { 12 | return createMenuItemSprite(picture, picture, callback, x, y); 13 | } 14 | 15 | MenuItemSprite* QMenu::createMenuItemSprite(const string& normal_picture, const string& pressed_picture, const ccMenuCallback& callback, int x, int y) 16 | { 17 | Sprite* normal = Sprite::create(normal_picture); 18 | Sprite* pressed = Sprite::create(pressed_picture); 19 | pressed->setPositionY(normal->getPositionX() - x); 20 | pressed->setPositionY(normal->getPositionY() - y); 21 | 22 | MenuItemSprite * item = MenuItemSprite::create(normal, pressed, callback); 23 | return item; 24 | } 25 | 26 | MenuItemLabel* QMenu::createMenuItemLabel(const string& text, const ccMenuCallback& callback) 27 | { 28 | Label* label = Label::create(text, QE_Font, 25); 29 | MenuItemLabel* item = MenuItemLabel::create(label, callback); 30 | item->setAnchorPoint(Vec2(0, 0)); 31 | return item; 32 | } 33 | 34 | Menu* QMenu::createMenuLabel(const string& text, const ccMenuCallback& callback) 35 | { 36 | MenuItemLabel* item = createMenuItemLabel(text, callback); 37 | item->setColor(Color3B::BLACK); 38 | Menu* menu = Menu::create(item, NULL); 39 | menu->setAnchorPoint(Vec2(0, 0)); 40 | return menu; 41 | } 42 | 43 | Menu* QMenu::createMenuSprite(const string& picture, const ccMenuCallback& callback, MenuItem *&item){ return createMenuSprite(picture, picture, callback, item); } 44 | 45 | Menu* QMenu::createMenuSprite(const string& picture, const string& pressedPicture, const ccMenuCallback& callback, MenuItem*& item) 46 | { 47 | item = createMenuItemSprite(picture, pressedPicture, callback); 48 | Menu* menu = Menu::create(item, NULL); 49 | menu->setAnchorPoint(Vec2(0, 0)); 50 | menu->setPosition(0, 0); 51 | return menu; 52 | } 53 | 54 | Menu* QMenu::createMenuSprite(const string& picture, const string& pressedPicture, const ccMenuCallback& callback){ return createMenuSprite(picture, pressedPicture, callback, _item); } 55 | 56 | Menu* QMenu::createMenuSprite(const string& picture, const ccMenuCallback& callback){ return createMenuSprite(picture, picture, callback); } 57 | 58 | void QMenu::releaseMenuItemVector(vector& menuItems) 59 | { 60 | for (vector::iterator it = menuItems.begin(); it != menuItems.end(); it++) 61 | { 62 | (*it)->removeFromParentAndCleanup(true); 63 | } 64 | menuItems.clear(); 65 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QMenu.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速菜单模块 8 | 含: 9 | 1.QMenu类 10 | 用途:用于快速创建菜单 11 | */ 12 | 13 | class QMenu 14 | { 15 | QE_SINGLETON_H(QMenu); 16 | 17 | public: 18 | static MenuItem* _item; 19 | static Menu* _menu; 20 | static MenuItemSprite* createMenuItemSprite(const string& picture, const ccMenuCallback& callback, int x=0, int y = 10); 21 | static MenuItemSprite* createMenuItemSprite(const string& normal_picture, const string& pressed_picture, const ccMenuCallback& callback, int x = 0, int y = 10); 22 | 23 | static MenuItemLabel* createMenuItemLabel(const string& text, const ccMenuCallback& callback); 24 | 25 | static Menu* createMenuLabel(const string& text, const ccMenuCallback& callback); 26 | static Menu* createMenuSprite(const string& picture, const ccMenuCallback& callback); 27 | static Menu* createMenuSprite(const string& picture, const string& pressedPicture, const ccMenuCallback& callback, MenuItem*& item); 28 | static Menu* createMenuSprite(const string& picture, const string& pressedPicture, const ccMenuCallback& callback); 29 | static Menu* createMenuSprite(const string& picture, const ccMenuCallback& callback, MenuItem *&item); 30 | 31 | static void releaseMenuItemVector(vector& menuItems); 32 | }; 33 | 34 | #define QE_CreateLabelMenu(__X__ , __Y__ ,__STR__, __TYPE__, __Fun__, ...) QMenu::_menu = QMenu::createMenuLabel(__STR__, bind(&__TYPE__::__Fun__, this, ##__VA_ARGS__)); \ 35 | QMenu::_menu->setPosition(__X__, __Y__); \ 36 | addChild(QMenu::_menu); 37 | 38 | #define QE_CreateSpriteMenu2(__X__ , __Y__ ,__NormalPicture__, __PressedPicture__, __TYPE__, __Fun__, ...) QMenu::_menu = QMenu::createMenuSprite(__NormalPicture__, __PressedPicture__, bind(&__TYPE__::__Fun__, this, ##__VA_ARGS__)); \ 39 | QMenu::_menu->setPosition(__X__, __Y__); \ 40 | addChild(QMenu::_menu); 41 | 42 | #define QE_CreateSpriteMenu(__X__ , __Y__ ,__PictureName__, __TYPE__, __Fun__, ...) \ 43 | QE_CreateSpriteMenu2(__X__, __Y__, __PictureName__, __PictureName__, __TYPE__, __Fun__, ##__VA_ARGS__) 44 | 45 | 46 | #define QE_addMenuTo(target) Menu* \ 47 | menu = Menu::createWithArray(items); \ 48 | menu->setAnchorPoint(Vec2(0, 0)); \ 49 | menu->setPosition(0, 0); \ 50 | target->addChild(menu); \ 51 | items.clear(); 52 | 53 | #define QE_addMenuToThis Menu* \ 54 | menu = Menu::createWithArray(items); \ 55 | menu->setAnchorPoint(Vec2(0, 0)); \ 56 | menu->setPosition(0, 0); \ 57 | addChild(menu); \ 58 | items.clear(); 59 | 60 | #define QE_addMenuToThisAgainWithPriority(_priority) \ 61 | menu = Menu::createWithArray(items); \ 62 | menu->setAnchorPoint(Vec2(0, 0)); \ 63 | menu->setPosition(0, 0); \ 64 | addChild(menu, _priority); \ 65 | items.clear(); -------------------------------------------------------------------------------- /Classes/QuickEngine/QMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QMessageBox.h" 4 | 5 | void QMessageBox(const string msg) { MessageBox(msg.c_str(), "通知"); } 6 | void QMessageBox(const string msg, const string title) { MessageBox(msg.c_str(), title.c_str()); } -------------------------------------------------------------------------------- /Classes/QuickEngine/QMessageBox.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | void QMessageBox(const string msg); 7 | void QMessageBox(const string msg, const string title); -------------------------------------------------------------------------------- /Classes/QuickEngine/QObject.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QObject.h" -------------------------------------------------------------------------------- /Classes/QuickEngine/QObject.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速对象模块 8 | 含: 9 | 1.QObject类 10 | 用途:用于快速管理对象 11 | */ 12 | 13 | class QObject 14 | { 15 | public: 16 | template 17 | static void releaseVector(vector& vec) 18 | { 19 | for (size_t i = 0, length = vec.size(); i < length; i++) 20 | { 21 | delete vec.at(i); 22 | } 23 | vec.clear(); 24 | } 25 | }; -------------------------------------------------------------------------------- /Classes/QuickEngine/QScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QScene.h" 4 | 5 | void QScene::saveNowSceneToFile() 6 | { 7 | QE_get_winSize; 8 | TextureCache::getInstance()->removeUnusedTextures(); 9 | //相当于截取暂停这一刹那的游戏界面图,并把它保存成pause.png 10 | auto texture = RenderTexture::create(winSize.width, winSize.height); 11 | texture->begin(); 12 | Director::getInstance()->getRunningScene()->visit(); 13 | texture->end(); 14 | texture->saveToFile("pause.png", Image::Format::PNG); 15 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | /* 5 | Quick Engine所属快速场景模块 6 | 含: 7 | 1.QScene类 8 | 用途:用于快速管理场景 9 | */ 10 | 11 | #include "cocos2d.h" 12 | USING_NS_CC; 13 | #include "QDesignMode.h" 14 | 15 | #define QE_ReplaceScene(__TYPE__) Director::getInstance()->replaceScene(TransitionPageTurn::create(1, __TYPE__::createScene(), false)); 16 | 17 | #define QE_winSize Size(960, 540); 18 | #define QE_get_winSize Size winSize = QE_winSize; 19 | 20 | #define QE_CreateSceneFromLayer_CPP(TYPE) \ 21 | Scene* TYPE::createScene() \ 22 | { \ 23 | Scene* scene = Scene::create(); \ 24 | Layer* layer = TYPE::create(); \ 25 | scene->addChild(layer); \ 26 | return scene; \ 27 | } \ 28 | \ 29 | bool TYPE::init() \ 30 | { \ 31 | if (!Layer::init()) \ 32 | { \ 33 | return false; \ 34 | } \ 35 | vector paths; 36 | 37 | #define QE_CreateSceneFromLayer_H(TYPE) \ 38 | public: \ 39 | static Scene* createScene(); \ 40 | virtual bool init(); \ 41 | CREATE_FUNC(TYPE); \ 42 | QE_get_winSize 43 | 44 | class QScene 45 | { 46 | public: 47 | //will save now scene to pause.png 48 | static void saveNowSceneToFile(); 49 | }; -------------------------------------------------------------------------------- /Classes/QuickEngine/QSprite.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QSprite.h" 4 | 5 | Sprite* QSprite::createBg(){return createBg("bg.png");} 6 | 7 | Sprite* QSprite::createBg(const std::string& filename) 8 | { 9 | //获取窗口大小 10 | Size size = Director::getInstance()->getWinSize(); 11 | //创建背景精灵 12 | Sprite* bg = Sprite::create(filename); 13 | //做适配 14 | float scaleX = size.width / bg->getContentSize().width; 15 | float scaleY = size.height / bg->getContentSize().height; 16 | bg->setScale(scaleX, scaleY); 17 | //设置位置 18 | bg->setPosition(Vec2(size.width / 2, size.height / 2)); 19 | return bg; 20 | } 21 | 22 | Sprite* QSprite::create(string fileName, int x, int y) 23 | { 24 | Sprite* spr = Sprite::create(fileName); 25 | spr->setAnchorPoint(Vec2(0, 0)); 26 | spr->setPosition(x, y); 27 | return spr; 28 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QSprite.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速精灵模块 8 | 含: 9 | 1.QSprite类 10 | 用途:用于快速管理精灵 11 | */ 12 | 13 | class QSprite 14 | { 15 | public: 16 | static Sprite* createBg(); 17 | static Sprite* createBg(const std::string& filename); 18 | static Sprite* create(string fileName, int x, int y); 19 | }; 20 | 21 | #define QE_addBgSprite addChild(QSprite::createBg()); 22 | #define QE_addBgSpriteWithName(__NAME__) addChild(QSprite::createBg(__NAME__)); 23 | #define QE_addSprite(fileName, x, y) addChild(QSprite::create(fileName, x, y)); -------------------------------------------------------------------------------- /Classes/QuickEngine/QString.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QString.h" 4 | 5 | int QString::getStringLetterNumber(string str, CharSet cs) 6 | { 7 | if (cs != UTF_8) 8 | { 9 | return -1; 10 | } 11 | const char* s = str.c_str(); 12 | int i = 0, j = 0; 13 | while (s[i]) 14 | { 15 | if ((s[i] & 0b11000000) != 0b10000000) j++; 16 | i++; 17 | } 18 | return j; 19 | } 20 | 21 | vector QString::strToVector(string str, CharSet cs) 22 | { 23 | vector vstr; 24 | if (cs != UTF_8) { return vstr; }; 25 | 26 | const char* s = str.c_str(); 27 | int i = 1, j = 0, l=0, sum=0; 28 | 29 | while (1) 30 | { 31 | if (s[i])//未到字符串的结尾,即未读取到'\0' 32 | { 33 | if ((s[i] & 0b11000000) != 0b10000000)//读取到一个新字符的开头 34 | { 35 | l = i - j; 36 | //CCLOG("f = %d, j=%d, l=%d, s=%s", flag, j, l, str.substr(j, l).c_str()); 37 | vstr.push_back(str.substr(j, l)); 38 | j = i; 39 | } 40 | i++; 41 | } 42 | else 43 | { 44 | l = i - j; 45 | vstr.push_back(str.substr(j, l)); 46 | break; 47 | } 48 | } 49 | return vstr; 50 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QString.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | /*开头第一句主要是为了完美解决C++ VS输出中文乱码痛点 3 | 概要: 4 | 使用高版本的VS,将源代码文件保存为utf-8格式,接着在源码开头处告诉编译器要用utf-8编码方案进行解析源代码。 5 | 这样做直接就可以了正常解析源码中的中文了,无需使用xml文档或者对源码中的中文字符进行额外的转码处理。 6 | 具体参考:https://blog.csdn.net/COCO56/article/details/91350176 7 | */ 8 | #pragma once 9 | 10 | #include "QuickEngine.h" 11 | 12 | /*QuickEngine为我自主开发的游戏引擎 13 | // #include "QuickEngine.h" 14 | // QString是QuickEngine中的一个模块,用于帮助其他开发者处理快速字符串相关的事件 15 | */ 16 | 17 | //#include 18 | //#include 19 | //using namespace std; 20 | 21 | class QString 22 | { 23 | enum CharSet 24 | { 25 | UTF_8 = 0 26 | }; 27 | public: 28 | /*暂时不处理非UTF_8编码的处理*/ 29 | //获取一个字符串中有多少个字符 30 | static int getStringLetterNumber(string str, CharSet cs = UTF_8); 31 | //将一个字符串中的所有字符都识别分离出来,并将每个字符保存为vector中的一个元素 32 | static vector strToVector(string str, CharSet cs = UTF_8); 33 | }; -------------------------------------------------------------------------------- /Classes/QuickEngine/QTMX.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "QTMX.h" 4 | 5 | void QTMX::initCoordinatesByTMXFile(vector& coordinates, const string& fileName, const string& objectGroupName) 6 | { 7 | coordinates.clear(); 8 | TMXTiledMap* tiledMap = TMXTiledMap::create(fileName); 9 | TMXObjectGroup* objGroup = tiledMap->getObjectGroup(objectGroupName); 10 | ValueVector values = objGroup->getObjects(); 11 | for (size_t i = 0, length = values.size(); i < length; i++) 12 | { 13 | ValueMap value = values.at(i).asValueMap(); 14 | int x = value.at("x").asInt(); 15 | int y = value.at("y").asInt(); 16 | coordinates.push_back(Coordinate(i, x, y)); 17 | } 18 | } 19 | 20 | void QTMX::initCoordinatesByTMXFile(Coordinate& coordinate, const string& fileName, const string& objectGroupName) 21 | { 22 | TMXTiledMap* tiledMap = TMXTiledMap::create(fileName); 23 | TMXObjectGroup* objGroup = tiledMap->getObjectGroup(objectGroupName); 24 | ValueVector values = objGroup->getObjects(); 25 | 26 | //判断解析的对象层是否有多个对象,如果有,向调用此接口的开发人员发出警告 27 | CCASSERT(values.size() == 1, "values.size not = 1"); 28 | ValueMap value = values.at(0).asValueMap(); 29 | int x = value.at("x").asInt(); 30 | int y = value.at("y").asInt(); 31 | coordinate = Coordinate(x, y); 32 | } -------------------------------------------------------------------------------- /Classes/QuickEngine/QTMX.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine.h" 5 | 6 | /* 7 | Quick Engine所属快速TMX模块 8 | 含: 9 | 1.QTMX类 10 | 用途:用于快速管理TMX文件,主要用于从TMX文件中解析坐标 11 | */ 12 | 13 | class QTMX 14 | { 15 | public: 16 | static void initCoordinatesByTMXFile(vector& coordinates,const string& fileName, const string& objectGroupName); 17 | static void initCoordinatesByTMXFile(Coordinate& coordinate, const string& fileName, const string& objectGroupName); 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /Classes/QuickEngine/QType.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | /* 5 | Quick Engine所属基本数据类型模块 6 | 含: 7 | 1.Coordinate类 8 | 用途:用于管理坐标 9 | */ 10 | 11 | 12 | class Coordinate 13 | { 14 | public: 15 | Coordinate(int num, int x, int y) : num(num), x(x), y(y) {}; 16 | Coordinate(int x, int y) : num(0), x(x), y(y) {}; 17 | Coordinate() : num(-1), x(-1), y(-1) {}; 18 | 19 | int num, x, y; 20 | }; 21 | 22 | #include "QuickEngine.h" -------------------------------------------------------------------------------- /Classes/QuickEngine/QuickEngine.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | /* 5 | Quick Engine模块 6 | 7 | QE V2.0 for Baby's_36_Skills 8 | 9 | QE(Quick Engine,快速引擎)简介: 10 | 基于Cocos2d-x 3.17.2、C++ 17构建,用来尽可能多地提升代码的复用性。 11 | QE具体表现为:优化默认的参数值及参数列表,使原来需要数行代码才能完成的功能,现在只需要一行代码就能完成。 12 | 13 | 比如: 14 | 1.快速生成背景精灵、设置锚点和位置均为(0, 0)、并添加到当前节点,只需要调用一个宏就行了。 15 | 记得把资源改成bg.png。 16 | 调用“QE_addBgSprite”这个宏即可,无需多于代码,也不需要传递任何参数 17 | 18 | 2.快速生成菜单,传两张图片的名以及一个可调用对象即可。 19 | 20 | 3.所有头文件只需要在这里包含一下,然后在相应的头文件中再包含一下此头文件就可以了。 21 | 这种你中有我,我中有你的设计效果可以大大减少包含的头文件数量。 22 | */ 23 | 24 | //宏 25 | //CB = callback 26 | #define QE_CB0(Type, Fun, ...) std::bind(&Type::Fun,this, ##__VA_ARGS__) 27 | //CBWT = callback with target 28 | #define QE_CBWT0(Type, Fun, targert, ...) std::bind(&Type::Fun,targert, ##__VA_ARGS__) 29 | //#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) 30 | #define QE_CALLBACK_1(Type,Fun) CC_CALLBACK_1(Type::Fun, this) 31 | //#define QE_Font "fonts/HannotateSC-W5.ttf" 32 | #define QE_Font "" 33 | 34 | //C++ 35 | using namespace std; 36 | 37 | //Cocos2d-x 38 | #include "cocos2d.h" 39 | USING_NS_CC; 40 | #include "SimpleAudioEngine.h" 41 | using namespace CocosDenshion; 42 | #include "ui/CocosGUI.h" 43 | using namespace cocos2d::ui; 44 | #include "network/SocketIO.h" 45 | #include "network/HttpClient.h" 46 | #include "network/WebSocket.h" 47 | using namespace cocos2d::network; 48 | 49 | //设计模式 50 | #include "QDesignMode.h" 51 | 52 | //QE 53 | #include "QType.h" 54 | #include "QScene.h" 55 | #include "QLayer.h" 56 | #include "QMenu.h" 57 | #include "QSprite.h" 58 | #include "QFileUtils.h" 59 | #include "QAnimate.h" 60 | #include "QObject.h" 61 | #include "QJson.h" 62 | #include "QTMX.h" 63 | #include "QEditBox.h" 64 | #include "QString.h" 65 | #include "QMessageBox.h" -------------------------------------------------------------------------------- /Classes/SingleGame/Battle.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class Battle :public Layer 7 | { 8 | public: 9 | static Scene * createScene(); 10 | virtual bool init(); 11 | CREATE_FUNC(Battle); 12 | 13 | 14 | void Lable_Set(Label *label1 ,String* str,int i); 15 | void showFont(float dt); 16 | void falseTextTurn(Ref *sender); 17 | void tureTextTurn(Ref *sender); 18 | void update(float f); 19 | void judeRight(); 20 | void returnScene(); 21 | void returnScene(float f); 22 | 23 | private: 24 | String content; 25 | int n ; 26 | Label *label; 27 | Label *label2; 28 | Dictionary *dic; 29 | Button *button; 30 | Button *button1; 31 | Size visibleSize; 32 | int Level; 33 | char Levels[20]; 34 | int I; 35 | int right; 36 | int LevelI; 37 | 38 | Size size; 39 | Sprite *bg1; 40 | Sprite *bg2; 41 | Sprite *bg3; 42 | Sprite *bg4; 43 | }; 44 | -------------------------------------------------------------------------------- /Classes/SingleGame/DataParse.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class DataParse 7 | { 8 | public: 9 | static Dictionary* getChapter(int chapterIndex); 10 | static void CopyFile(); 11 | 12 | static int getNum( int levelIndex); 13 | static int getStar( int levelIndex); 14 | static void setStar( int levelIndex, int starNum); 15 | static void writefile(Document& document, string path); 16 | static int getclok(int levelIndex); 17 | }; 18 | -------------------------------------------------------------------------------- /Classes/SingleGame/HRocker.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Classes/SingleGame/HRocker.h -------------------------------------------------------------------------------- /Classes/SingleGame/MapFive.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class MapFive :public Layer,public animation 7 | { 8 | public: 9 | static Scene * createScene(); 10 | virtual bool init(); 11 | CREATE_FUNC(MapFive); 12 | void backFive(); 13 | private: 14 | Sprite* hero; 15 | 16 | bool HeroDirecton5; 17 | 18 | void update(float f); 19 | void PlayerPoint(Point p); 20 | void heroRound(float d); 21 | Point movePlayer(Point p,Point p3); 22 | 23 | Point moveBad(bool s,Point ph); 24 | void heroBadRounf(float d); 25 | Sprite *chu; 26 | 27 | int k1; 28 | int kj; 29 | int j; 30 | 31 | 32 | Sprite * herohrea5; 33 | 34 | static Layer * layer; 35 | Point p2; 36 | Sprite * heroBad5; 37 | float y; 38 | float x; 39 | }; 40 | 41 | class HrockerLayer5:public Layer 42 | { 43 | public: 44 | static Scene * createScene(); 45 | virtual bool init(); 46 | CREATE_FUNC(HrockerLayer5); 47 | }; 48 | -------------------------------------------------------------------------------- /Classes/SingleGame/MapFour.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | 7 | class MapFour :public Layer,public animation 8 | { 9 | public: 10 | static Scene * createScene(); 11 | virtual bool init(); 12 | CREATE_FUNC(MapFour); 13 | void backFour(); 14 | 15 | Sprite* hero; 16 | bool HeroDirecton4; 17 | 18 | void update(float f); 19 | void PlayerPoint(Point p); 20 | void heroRound(float d); 21 | Point movePlayer(Point p,Point p3); 22 | 23 | Point moveBad(bool s,Point ph); 24 | void heroBadRounf(float d); 25 | Sprite *chu; 26 | 27 | int k1; 28 | int kj; 29 | int j; 30 | 31 | private: 32 | Sprite * herohrea4; 33 | 34 | static Layer * layer; 35 | Point p2; 36 | Sprite * heroBad4; 37 | float y; 38 | float x; 39 | }; 40 | 41 | class HrockerLayer4:public Layer 42 | { 43 | public: 44 | static Scene * createScene(); 45 | virtual bool init(); 46 | CREATE_FUNC(HrockerLayer4); 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /Classes/SingleGame/MapOne.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class MapOne : public Layer, public animation 7 | { 8 | public: 9 | static Scene * createScene(); 10 | virtual bool init(); 11 | CREATE_FUNC(MapOne); 12 | 13 | 14 | void PlayerPoint(Point p); 15 | 16 | void RunEnd(); 17 | void StopAnimation(); 18 | void SetAnimation(const char* name_plist, const char* name_png, const char* name_each, unsigned int num, bool run_directon,int f); 19 | Animation* getAnimation(const char* name_plist, const char* name_png, const char* name_each, const unsigned int num, bool run_directon); 20 | void update(float f); 21 | 22 | private: 23 | Sprite* _player; 24 | void back(); 25 | void back1(); 26 | void back2(); 27 | void back3(); 28 | void MoveMap(Point position); 29 | void movePlayer(Vec2 p); 30 | 31 | Sprite *_player1; 32 | Sprite *_player2; 33 | Sprite *_player3; 34 | Sprite *_player4; 35 | Sprite *_player5; 36 | Sprite *hero; 37 | }; 38 | 39 | class HrockerLayer:public Layer 40 | { 41 | public: 42 | static Scene * createScene(); 43 | virtual bool init(); 44 | CREATE_FUNC(HrockerLayer); 45 | }; 46 | -------------------------------------------------------------------------------- /Classes/SingleGame/MapThere.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class MapThere :public Layer,public animation 7 | { 8 | public: 9 | static Scene *createScene(); 10 | virtual bool init(); 11 | CREATE_FUNC(MapThere); 12 | void backThere(); 13 | 14 | bool HeroDirecton3; 15 | 16 | void update(float f); 17 | void PlayerPoint(Point p); 18 | void heroRound(float d); 19 | Point movePlayer(Point p,Point p3); 20 | 21 | Point moveBad(bool s,Point ph); 22 | void heroBadRounf(float d); 23 | 24 | Sprite *chu; 25 | int k1; 26 | int kj; 27 | int j; 28 | 29 | private: 30 | Sprite *herohrea3; 31 | 32 | static Layer *layer; 33 | Point p2; 34 | Sprite *heroBad3; 35 | float y; 36 | float x; 37 | }; 38 | 39 | class HrockerLayer3:public Layer 40 | { 41 | public: 42 | static Scene *createScene(); 43 | virtual bool init(); 44 | CREATE_FUNC(HrockerLayer3); 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /Classes/SingleGame/MapTwo.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QE.h" 5 | 6 | class MapTwo :public Layer,public animation 7 | { 8 | public: 9 | static Scene * createScene(); 10 | virtual bool init(); 11 | CREATE_FUNC(MapTwo); 12 | void backTwo(); 13 | void update(float f); 14 | void PlayerPoint(Point p); 15 | void heroRound(float d); 16 | Point movePlayer(Point p,Point p3); 17 | 18 | Point moveBad(bool s,Point ph); 19 | void heroBadRounf(float d); 20 | 21 | int count ,k1, kj, j; 22 | 23 | private: 24 | Sprite *herohrea; 25 | bool HeroDirecton; 26 | static Layer *layer; 27 | Point p2; 28 | Sprite *heroBad; 29 | float y; 30 | float x; 31 | Sprite *chu; 32 | }; 33 | 34 | class HrockerLayer2:public Layer 35 | { 36 | public: 37 | static Scene *createScene(); 38 | virtual bool init(); 39 | CREATE_FUNC(HrockerLayer2); 40 | }; 41 | -------------------------------------------------------------------------------- /Classes/SingleGame/animation.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "animation.h" 4 | 5 | void animation::StopAnimation( Sprite * hero1) 6 | { 7 | if (!IsRunning){ return; } 8 | 9 | hero1->stopAllActions(); 10 | IsRunning = false; 11 | } 12 | 13 | 14 | void animation::SetAnimation(const char* name_plist, const char* name_png, const char* name_each, unsigned int num, bool run_directon,Sprite * hero1,int i) 15 | { 16 | if (HeroDirecton != run_directon) 17 | { 18 | HeroDirecton = run_directon; 19 | hero1->setFlippedX(run_directon); 20 | } 21 | 22 | if (IsRunning){ return; } 23 | 24 | auto ani = getAnimation(name_plist, name_png, name_each, num, hero1,run_directon); 25 | auto action = Animate::create(ani); 26 | 27 | auto ccback = CallFunc::create(CC_CALLBACK_0(animation::RunEnd, this)); 28 | auto act = Sequence::create(action,ccback, NULL); 29 | hero1->runAction(act); 30 | 31 | IsRunning = true; 32 | } 33 | 34 | void animation::RunEnd() 35 | { 36 | IsRunning = false; 37 | } 38 | 39 | Animation* animation::getAnimation(const char* name_plist, const char* name_png, const char* name_each, const unsigned int num,Sprite * hero1, bool run_directon) 40 | { 41 | auto cache = SpriteFrameCache::getInstance(); 42 | cache->addSpriteFramesWithFile(name_plist, name_png); 43 | hero1->setTexture(String::createWithFormat("%s1.png", name_each)->getCString()); 44 | auto spriteBatch = SpriteBatchNode::create(name_png); 45 | //addChild(spriteBatch); 46 | Vector animFrames(num); 47 | for (int i = 1; i < num; i++) 48 | { 49 | auto frame = cache->getSpriteFrameByName(String::createWithFormat("%s%d.png", name_each, i)->getCString()); 50 | animFrames.pushBack(frame); 51 | } 52 | auto animation = Animation::createWithSpriteFrames(animFrames, 0.2f); 53 | return animation; 54 | } 55 | -------------------------------------------------------------------------------- /Classes/SingleGame/animation.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "QuickEngine/QuickEngine.h" 5 | 6 | class animation 7 | { 8 | public: 9 | void RunEnd(); 10 | void StopAnimation(Sprite * hero1); 11 | void SetAnimation(const char* name_plist, const char* name_png, const char* name_each, unsigned int num, bool run_directon,Sprite * hero1,int f); 12 | Animation* getAnimation(const char* name_plist, const char* name_png, const char* name_each, const unsigned int num, Sprite * hero1,bool run_directon); 13 | private: 14 | bool IsRunning; 15 | bool HeroDirecton; 16 | }; -------------------------------------------------------------------------------- /Classes/Test/HelloWorldScene.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "HelloWorldScene.h" 4 | 5 | QE_CreateSceneFromLayer_CPP(HelloWorld); 6 | return true; 7 | } -------------------------------------------------------------------------------- /Classes/Test/HelloWorldScene.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "../QE.h" 5 | 6 | class HelloWorld : public Layer 7 | { 8 | QE_CreateSceneFromLayer_H(HelloWorld); 9 | public: 10 | }; -------------------------------------------------------------------------------- /Classes/Test/HttpTest.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "HttpTest.h" 4 | 5 | Label* HttpTest::label; 6 | 7 | QE_CreateSceneFromLayer_CPP(HttpTest); 8 | label = Label::create("", "Marker Felt.ttf", 24); 9 | label->setAnchorPoint(Vec2(0, 0)); 10 | label->setPosition(10, 300); 11 | addChild(label); 12 | 13 | label->setString("init"); 14 | 15 | postHttpRequest(); 16 | 17 | return true; 18 | } 19 | 20 | void HttpTest::postHttpRequest() 21 | { 22 | HttpRequest* request = new HttpRequest(); 23 | string url = "http://10.6.32.1:8080/user/login.action"; 24 | url = "https://www.baidu.com:80/"; 25 | 26 | request->setUrl(url); 27 | request->setRequestType(HttpRequest::Type::POST); 28 | request->setResponseCallback(CC_CALLBACK_2(HttpTest::onHttpRequestCompleted, this)); 29 | 30 | // write the post data 31 | const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest"; 32 | postData = ""; 33 | request->setRequestData(postData, strlen(postData)); 34 | request->setTag("POST test"); 35 | cocos2d::network::HttpClient::getInstance()->send(request); 36 | request->release(); 37 | } 38 | 39 | void HttpTest::onHttpRequestCompleted(HttpClient* sender, HttpResponse* response) 40 | { 41 | string show; 42 | if (!response) 43 | { 44 | return; 45 | } 46 | 47 | // You can get original request type from: response->request->reqType 48 | if (0 != strlen(response->getHttpRequest()->getTag())) 49 | { 50 | CCLOG("%s completed", response->getHttpRequest()->getTag()); 51 | } 52 | int statusCode = response->getResponseCode(); 53 | char statusString[64] = {}; 54 | sprintf(statusString, "HTTP Status Code: %d, tag = %s", statusCode, response->getHttpRequest()->getTag()); 55 | CCLOG("response code: %d", statusCode); 56 | show += "status:"; 57 | show += to_string(statusCode); 58 | if (!response->isSucceed()) 59 | { 60 | CCLOG("response failed"); 61 | CCLOG("error buffer: %s", response->getErrorBuffer()); 62 | return; 63 | } 64 | // dump data 65 | //std::vector* buffer = response->getResponseData()->data; 66 | std::vector* buffer = response->getResponseData(); 67 | CCLOG("Http Test, dump data: "); 68 | string buf; 69 | //CCLOG("%s", buffer); 70 | for (unsigned int i = 0; i < buffer->size(); i++) 71 | { 72 | buf += (*buffer)[i]; 73 | //CCLOG("%c", ); 74 | } 75 | show += ", buf:"; 76 | show += buf; 77 | label->setString(show); 78 | CCLOG("%s", show.c_str()); 79 | CCLOG("len = %d", buf.length()); 80 | } -------------------------------------------------------------------------------- /Classes/Test/HttpTest.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "../QE.h" 5 | 6 | class HttpTest : public cocos2d::Layer 7 | { 8 | QE_CreateSceneFromLayer_H(HttpTest); 9 | static Label* label; 10 | // 请求方法 11 | void postHttpRequest(); 12 | // 请求完成的回调方法 13 | void onHttpRequestCompleted(HttpClient* sender, HttpResponse* response); 14 | 15 | }; -------------------------------------------------------------------------------- /Classes/Test/PopAlertDialog.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") -------------------------------------------------------------------------------- /Classes/Test/PopAlertDialog.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "../QE.h" -------------------------------------------------------------------------------- /Classes/Test/SignInSceneTest.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "SignInSceneTest.h" 4 | 5 | EditBox* SignInSceneTest::_idBox, * SignInSceneTest::_passwordBox; 6 | 7 | QE_CreateSceneFromLayer_CPP(SignInSceneTest); 8 | paths = { "fonts" }; 9 | QE_SetResourcesSearchDir; 10 | 11 | //Connect::connect("登录测试"); 12 | 13 | createLabel("请登录,如果没有账号请先注册。"); 14 | _label->setPosition(150, 150); 15 | _logLabel = _label; 16 | 17 | initMenu(); 18 | initEditBox(); 19 | return true; 20 | } 21 | 22 | void SignInSceneTest::initMenu() 23 | { 24 | _label = Label::create("登录", QE_Font, 25); 25 | MenuItemLabel* inItem = MenuItemLabel::create(_label, bind(&SignInSceneTest::SignIn, this)); 26 | inItem->setPosition(410, 270); 27 | 28 | _label = Label::create("注册", QE_Font, 25); 29 | MenuItemLabel* upItem = MenuItemLabel::create(_label, bind(&SignInSceneTest::SignUp, this)); 30 | upItem->setPosition(540, 270); 31 | 32 | Menu* mn = Menu::create(inItem, upItem, NULL); 33 | mn->setPosition(0, 0); 34 | addChild(mn); 35 | } 36 | 37 | void SignInSceneTest::SignIn() 38 | { 39 | 40 | } 41 | void SignInSceneTest::SignUp() 42 | { 43 | 44 | } 45 | 46 | void SignInSceneTest::initEditBox() 47 | { 48 | EditBox* box; 49 | //输入ID的框 50 | box = createEditBox("green_edit.png"); 51 | box->setPosition(Vec2(480, 380)); 52 | box->setPlaceHolder("ID或用户名"); //当编辑框中没有任何字符(或输入字符前)的提示文本,即占位符 53 | //输入密码的框 54 | box = createEditBox("orange_edit.png"); 55 | box->setPosition(Vec2(480, 330)); 56 | box->setPlaceHolder("密码"); 57 | box->setInputFlag(EditBox::InputFlag::PASSWORD);////设置文本框显示文本的样式,输入密码标记 58 | } -------------------------------------------------------------------------------- /Classes/Test/SignInSceneTest.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "../QE.h" 5 | 6 | class SignInSceneTest : public Layer, public EditBoxDelegate, public NetworkBaseScene 7 | { 8 | QE_CreateSceneFromLayer_H(SignInSceneTest); 9 | NW_BaseScene; 10 | public: 11 | //服务器状态相关 12 | static EditBox* _idBox, * _passwordBox; 13 | 14 | private: 15 | void initLabel() {}; 16 | 17 | //菜单相关 18 | void initMenu(); 19 | //菜单按钮回调函数相关 20 | void SignIn(); 21 | void SignUp(); 22 | 23 | //输入框相关 24 | void initEditBox(); 25 | }; -------------------------------------------------------------------------------- /Classes/Test/SocketIOTestLayer.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "SocketIOTestLayer.h" 4 | 5 | SIOClient* SocketIOTestLayer::_sioClient; 6 | bool SocketIOTestLayer::isConnect = false; 7 | string SocketIOTestLayer::addr; 8 | Label* SocketIOTestLayer::label = nullptr, * SocketIOTestLayer::logLabel=nullptr; 9 | 10 | QE_SINGLETON_CPP(SocketIOTestLayer); 11 | 12 | QE_CreateSceneFromLayer_CPP(SocketIOTestLayer); 13 | paths = { "fonts" }; 14 | QE_SetResourcesSearchDir; 15 | 16 | label = Label::create("SIO", "Marker Felt.ttf", 20); 17 | label->setPosition(10, 270); 18 | label->setAnchorPoint(Vec2(0, 0)); 19 | addChild(label); 20 | 21 | logLabel = Label::create("SIO LOG", "Marker Felt.ttf", 20); 22 | logLabel->setPosition(10, 220); 23 | logLabel->setAnchorPoint(Vec2(0, 0)); 24 | addChild(logLabel); 25 | 26 | connect(); 27 | 28 | return true; 29 | } 30 | 31 | void SocketIOTestLayer::updateLabel() 32 | { 33 | if (SocketIOTestLayer::isConnect) { label->setString("Successful"); } 34 | else { label->setString("Failed"); } 35 | } 36 | 37 | void SocketIOTestLayer::connect() 38 | { 39 | if (!isConnect) { SocketIOTestLayer::getInstance()->initSocket(); }; 40 | } 41 | 42 | void SocketIOTestLayer::initSocket() 43 | { 44 | string ip = "10.6.32.1"; 45 | //ip = "localhost"; 46 | string port = "80"; 47 | addr = "ws://" + ip + ":" + port + "/"; 48 | _sioClient = SocketIO::connect(addr, *this); 49 | //注册服务器端事件 50 | _sioClient->on("callClientEvent", CC_CALLBACK_2(SocketIOTestLayer::callClientEvent, this)); 51 | } 52 | 53 | //委托协议方法 54 | void SocketIOTestLayer::onConnect(SIOClient* client) 55 | { 56 | updateStatus(true); 57 | CCLOG("HelloWorld::onConnect called"); 58 | String* s = String::createWithFormat("%s connected!", client->getTag()); 59 | _sioClient->send("Hello, I am cocos2d-x, send()"); 60 | } 61 | 62 | void SocketIOTestLayer::onMessage(SIOClient* client, const std::string& data) 63 | { 64 | updateStatus(true); 65 | CCLOG("HelloWorld::onMessage received: %s", data.c_str()); 66 | String* s = String::createWithFormat("%s received message.", client->getTag()); 67 | } 68 | 69 | void SocketIOTestLayer::onClose(SIOClient* client) 70 | { 71 | updateStatus(false); 72 | CCLOG("HelloWorld::onClose called"); 73 | if (client == _sioClient) { 74 | _sioClient = nullptr; 75 | } 76 | } 77 | 78 | void SocketIOTestLayer::onError(SIOClient* client, const std::string& data) 79 | { 80 | updateStatus(false); 81 | string error = data.c_str(); 82 | logLabel->setString("onError:" + error + "||" + addr); 83 | //CCLOG("HelloWorld::onError received: %s", data.c_str()); 84 | //String* s = String::createWithFormat("%s received error .", client->getTag()); 85 | } 86 | 87 | void SocketIOTestLayer::callClientEvent(SIOClient* client, const std::string& data) 88 | { 89 | updateStatus(true); 90 | CCLOG("HelloWorld::callClientEvent received: %s", data.c_str()); 91 | String* s = String::createWithFormat("%s Server CallBack", client->getTag()); 92 | } 93 | 94 | void SocketIOTestLayer::updateStatus(bool status) 95 | { 96 | isConnect = status; 97 | updateLabel(); 98 | } -------------------------------------------------------------------------------- /Classes/Test/SocketIOTestLayer.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "../QE.h" 5 | 6 | class SocketIOTestLayer : public Layer, public SocketIO::SIODelegate 7 | { 8 | QE_CreateSceneFromLayer_H(SocketIOTestLayer); 9 | QE_SINGLETON_H(SocketIOTestLayer); 10 | 11 | public: 12 | static SIOClient* _sioClient; 13 | static bool isConnect; 14 | static string addr; 15 | static void connect(); 16 | 17 | static Label* label, *logLabel; 18 | 19 | private: 20 | void initSocket(); 21 | virtual void onConnect(SIOClient* client); 22 | virtual void onMessage(SIOClient* client, const string& data); 23 | virtual void onClose(SIOClient* client); 24 | virtual void onError(SIOClient* client, const string& data); 25 | void callClientEvent(SIOClient* client, const string& data); 26 | void updateStatus(bool status); 27 | void updateLabel(); 28 | }; -------------------------------------------------------------------------------- /Classes/Test/WebSocketTestLayer.cpp: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | 3 | #include "WebSocketTestLayer.h" 4 | 5 | Label* WebSocketTestLayer::label; 6 | int WebSocketTestLayer::_sendTextTimes = 0; 7 | 8 | QE_CreateSceneFromLayer_CPP(WebSocketTestLayer); 9 | //初始化菜单 10 | initMenu(); 11 | 12 | label = Label::create("", "Marker Felt.ttf", 24); 13 | label->setAnchorPoint(Vec2(0, 0)); 14 | label->setPosition(10, 300); 15 | addChild(label); 16 | 17 | label->setString("initWeb"); 18 | 19 | _wsiSendText = new WebSocket(); 20 | string aim = "ws://echo.websocket.org"; 21 | aim = "ws://10.6.32.1"; 22 | aim = "ws://10.6.32.1:80"; 23 | aim = "ws://10.6.32.1:56"; 24 | _wsiSendText->init(*this, aim); 25 | 26 | return true; 27 | } 28 | 29 | void WebSocketTestLayer::initMenu() 30 | { 31 | label = Label::create("Send msg", "Marker Felt.ttf", 25); 32 | MenuItemLabel* sendMsgItem = MenuItemLabel::create(label, bind(&WebSocketTestLayer::sendMsg, this)); 33 | sendMsgItem->setPosition(410, 200); 34 | 35 | Menu* mn = Menu::create(sendMsgItem, NULL); 36 | mn->setPosition(0, 0); 37 | addChild(mn); 38 | } 39 | 40 | void WebSocketTestLayer::sendMsg() 41 | { 42 | _wsiSendText->send("Hello, I am Cocos2d-x"); 43 | } 44 | 45 | void WebSocketTestLayer::onOpen(WebSocket* ws) 46 | { 47 | if (ws == _wsiSendText) 48 | { 49 | label->setString("Send Text WS was opened."); 50 | } 51 | //label->setString("onOpen"); 52 | } 53 | 54 | void WebSocketTestLayer::onMessage(WebSocket* ws, const WebSocket::Data& data) 55 | { 56 | if (!data.isBinary) 57 | { 58 | _sendTextTimes++; 59 | char times[100] = { 0 }; 60 | sprintf(times, "%d", _sendTextTimes); 61 | std::string textStr = std::string("response text msg: ") + data.bytes + ", " + times; 62 | CCLOG("%s", textStr.c_str()); 63 | label->setString(textStr.c_str()); 64 | } 65 | } 66 | 67 | void WebSocketTestLayer::onClose(network::WebSocket* ws) 68 | { 69 | if (ws == _wsiSendText) 70 | { 71 | _wsiSendText = NULL; 72 | } 73 | CC_SAFE_DELETE(ws); 74 | } 75 | 76 | void WebSocketTestLayer::onError(network::WebSocket* ws, const network::WebSocket::ErrorCode& error) 77 | { 78 | CCLOG("Error was fired, error code: %d", error); 79 | if (ws == _wsiSendText) 80 | { 81 | char buf[100] = { 0 }; 82 | sprintf(buf, "an error was fired, code: %d", error); 83 | label->setString(buf); 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /Classes/Test/WebSocketTestLayer.h: -------------------------------------------------------------------------------- 1 | #pragma execution_character_set("utf-8") 2 | #pragma once 3 | 4 | #include "../QE.h" 5 | 6 | class WebSocketTestLayer : public Layer, public WebSocket::Delegate 7 | { 8 | QE_CreateSceneFromLayer_H(WebSocketTestLayer); 9 | 10 | static Label* label; 11 | static int _sendTextTimes; 12 | WebSocket* _wsiSendText; 13 | 14 | void initMenu(); 15 | 16 | void sendMsg(); 17 | 18 | virtual void onOpen(cocos2d::network::WebSocket* ws); 19 | 20 | virtual void onMessage(cocos2d::network::WebSocket* ws, const cocos2d::network::WebSocket::Data& data); 21 | 22 | virtual void onClose(cocos2d::network::WebSocket* ws); 23 | 24 | virtual void onError(cocos2d::network::WebSocket* ws, const cocos2d::network::WebSocket::ErrorCode& error); 25 | }; -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | [toc] 2 | 3 | # 1. 设计规范 4 | 1. 屏幕设计分辨率 5 | 960*540 6 | 2. 游戏总场景地图大小 7 | 1920*1080 8 | 3. 游戏具体场景地图大小 9 | 960*540 10 | 4. IDE:Microsoft Visual Studio Enterprise 2019 版本 16.1.1 11 | VisualStudio.16.Release/16.1.1+28922.388 12 | 5. 二维游戏引擎:Cocos 3.17.2 13 | QE V2.0 for Baby's_36_Skills 14 | 6. Tiled:Tiled for Windows (64-bit), snapshot Version 2019.05.08 15 | 说明:为了增强兼容性,地图使用Tiled铺设,不用Cocos Studio 16 | 7. 服务器开发 17 | 服务器应用开发使用 Node.js v12.3.1 18 | socket.io 2.2.0 19 | 8. 数据库 20 | 数据库为关系型数据库,数据库管理系统为MySQL Community Server version: 8.0.16 21 | 9. 许可证:GUN GPL3.0 22 | 许可概要:他人修改后源码后也必须开源并且新增代码要同样采用GUN GPL3.0许可证 23 | 24 | # 2. 说明 25 | ## 2.1. 打包支持 26 | Cocos2d-x 3.3与3.10、3.17.1、3.17.2打包到安卓教程: 27 | [点击进入](https://blog.csdn.net/COCO56/article/details/89392349) 28 | 29 | ## 2.2. 特色 30 | 自主研发了QE(Quick Engine),大大减少了代码的重复率,使代码看起来更简洁,开发起来更高效。 31 | 32 | ## 2.3. 代码仓与文档: 33 | * 文档地址:[https://blog.csdn.net/COCO56/article/details/90384628](https://blog.csdn.net/COCO56/article/details/90384628) 34 | * 开源地址 :[https://github.com/cocos56/Baby-s_36_Skills](https://github.com/cocos56/Baby-s_36_Skills) 35 | 36 | 44 | 45 | # 3. 游戏简介 46 | * 英文名:Baby's_36_Skills 47 | * 宝贝三十六计是一款针对3-6岁儿童的益智策略类游戏,主要用来教会宝宝识别坏人的伎俩,不轻易相信坏人。 48 | # 4. 基本玩法: 49 | * 单机模式下:宝宝可以在地图上随意走动,当碰到坏人时会切换到与坏人交流的场景(类似于回合制游戏,你打我一下,我打你一下,不过这里是两个人对话交流),如果宝宝最终识破了坏人的伎俩,没有跟随坏人离去,则坏人从地图上消失,当当前关卡所有坏人全部消失时,游戏胜利。如果宝宝跟随坏人离去,则游戏失败,需要重新开始游戏。每个坏人随机采用一种内置的一种策略来尝试诱骗宝宝。 50 | * 联网模式下:其他人(如孩子父母,或者别人的父母)可以自定义扮演坏人角色来尝试与宝宝交流,来诱骗宝宝,宝宝成功识破,游戏胜利,如未成功识破,游戏失败。 -------------------------------------------------------------------------------- /Resources/0%.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/0%.png -------------------------------------------------------------------------------- /Resources/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/0.png -------------------------------------------------------------------------------- /Resources/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/100.png -------------------------------------------------------------------------------- /Resources/124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/124.png -------------------------------------------------------------------------------- /Resources/2123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/2123.png -------------------------------------------------------------------------------- /Resources/BackGround.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/BackGround.png -------------------------------------------------------------------------------- /Resources/Cillidable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/Cillidable.png -------------------------------------------------------------------------------- /Resources/ConnectServerScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/ConnectServerScene/bg.png -------------------------------------------------------------------------------- /Resources/ConnectServerScene/editBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/ConnectServerScene/editBox.png -------------------------------------------------------------------------------- /Resources/CreateRoomScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/CreateRoomScene/bg.png -------------------------------------------------------------------------------- /Resources/CreateRoomScene/confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/CreateRoomScene/confirm.png -------------------------------------------------------------------------------- /Resources/CreateRoomScene/editBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/CreateRoomScene/editBox.png -------------------------------------------------------------------------------- /Resources/CreateRoomScene/editBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/CreateRoomScene/editBoxPressed.png -------------------------------------------------------------------------------- /Resources/CreateRoomScene/final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/CreateRoomScene/final.png -------------------------------------------------------------------------------- /Resources/Data.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_11":{"word":"小朋友,我有一个礼物给你。你想知道是什么吗?快和我到前面车里去看看吧。", "prue":0}, 3 | "level_12":{"word":"叔叔第一次来这个地方,很喜欢熊猫,却不知道地方,你可以帮叔叔吗", "prue":1}, 4 | "level_13":{"word":"叔叔这里有很多好吃的零食,你帮了叔叔,我把它全给你吃", "prue":1}, 5 | "level_14":{"word":"你真棒啊,帮叔叔找到了熊猫馆,为了谢谢你,叔叔带你去吃麦当劳好吗?", "prue":1}, 6 | "level_15":{"word":"要是不吃好吃的,我带你去买个玩具送给你怎么样?", "prue":1}, 7 | "level_16":{"word":"你放心,很快就可以买好东西,把你送回来,走吧。", "prue":1}, 8 | 9 | "level_21":{"word":"小朋友,你是张鑫(角色家长)的儿子吗?", "prue":0}, 10 | "level_22":{"word":"你的妈妈出事故了,这会儿已经到了医院。", "prue":1}, 11 | "level_23":{"word":"我是你妈妈的同事,她在红光小学当老师。", "prue":0}, 12 | "level_24":{"word":"她是语文老师,很受学生欢迎的。", "prue":0}, 13 | "level_25":{"word":"今天她的手臂不小心受伤了", "prue":0}, 14 | "level_26":{"word":"快点跟叔叔走吧", "prue":1}, 15 | 16 | "level_31":{"word":"小朋友一个人吗?", "prue":0}, 17 | "level_32":{"word":"叔叔这里有棒棒糖,你吃吗?", "prue":1}, 18 | "level_33":{"word":"带你去吃冰淇淋好吗?超好吃的", "prue":1}, 19 | "level_34":{"word":"玩具要吗?带去买电动玩具赛车,超好玩的。", "prue":1}, 20 | "level_35":{"word":"你在这里等家长很无聊的,叔叔带你去看电影", "prue":1}, 21 | "level_36":{"word":"我已经和你爸说了,跟我走吧", "prue":1}, 22 | 23 | "level_41":{"word":"小朋友,叔叔带你回家。", "prue":1}, 24 | "level_42":{"word":"你妈妈今天有事来不了了,她让我带你回去,跟我走吧", "prue":1}, 25 | "level_43":{"word":"你的妈妈叫张鑫(角色家长)", "prue":0}, 26 | "level_44":{"word":"你的家在湖滨小区(角色住址) ", "prue":0}, 27 | "level_45":{"word":"周围有一个大湖,对吧?", "prue":0}, 28 | "level_46":{"word":"现在已经很晚了,我带你去吃肯德基,走吧", "prue":1} 29 | } -------------------------------------------------------------------------------- /Resources/GameInterfaceScene/beginGame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GameInterfaceScene/beginGame.png -------------------------------------------------------------------------------- /Resources/GameInterfaceScene/beginNetworkGame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GameInterfaceScene/beginNetworkGame.png -------------------------------------------------------------------------------- /Resources/GameInterfaceScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GameInterfaceScene/bg.png -------------------------------------------------------------------------------- /Resources/GameInterfaceScene/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GameInterfaceScene/quit.png -------------------------------------------------------------------------------- /Resources/GameInterfaceScene/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GameInterfaceScene/setting.png -------------------------------------------------------------------------------- /Resources/GetRoomsScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GetRoomsScene/bg.png -------------------------------------------------------------------------------- /Resources/GetRoomsScene/checkbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GetRoomsScene/checkbutton.png -------------------------------------------------------------------------------- /Resources/GetRoomsScene/createbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GetRoomsScene/createbutton.png -------------------------------------------------------------------------------- /Resources/GetRoomsScene/joinbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GetRoomsScene/joinbutton.png -------------------------------------------------------------------------------- /Resources/GetRoomsScene/roomcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GetRoomsScene/roomcard.png -------------------------------------------------------------------------------- /Resources/GetRoomsScene/roomcardbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/GetRoomsScene/roomcardbg.png -------------------------------------------------------------------------------- /Resources/HOSP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/HOSP.png -------------------------------------------------------------------------------- /Resources/JoinRoomScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/JoinRoomScene/bg.png -------------------------------------------------------------------------------- /Resources/JoinRoomScene/confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/JoinRoomScene/confirm.png -------------------------------------------------------------------------------- /Resources/JoinRoomScene/editBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/JoinRoomScene/editBox.png -------------------------------------------------------------------------------- /Resources/JoinRoomScene/editBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/JoinRoomScene/editBoxPressed.png -------------------------------------------------------------------------------- /Resources/MapTwo.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | eJzVzqkRADAMA0E7n/P1X28OmgoG7IzEzs2soKLBhd8xEJjiX9g4uOLPDerODerODer+sfkBKQEDPQ== 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Resources/Nbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/Nbutton.png -------------------------------------------------------------------------------- /Resources/Nbutton1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/Nbutton1.png -------------------------------------------------------------------------------- /Resources/NetworkGameOverScene/babyLose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameOverScene/babyLose.png -------------------------------------------------------------------------------- /Resources/NetworkGameOverScene/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameOverScene/back.png -------------------------------------------------------------------------------- /Resources/NetworkGameOverScene/refereeLose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameOverScene/refereeLose.png -------------------------------------------------------------------------------- /Resources/NetworkGameOverScene/scoundrelLose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameOverScene/scoundrelLose.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/baby'sTurn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/baby'sTurn.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/baby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/baby.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/babyPP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/babyPP.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/babyWin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/babyWin.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/back.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/bg.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/chat.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/chatBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/chatBg.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/confirm - 副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/confirm - 副本.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/confirm.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/editBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/editBox.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/editBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/editBoxPressed.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/goOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/goOn.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/no.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/referee'sTurn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/referee'sTurn.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/referee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/referee.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/refereeConfirm - 副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/refereeConfirm - 副本.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/refereeConfirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/refereeConfirm.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/refereePP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/refereePP.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/scoundrel'sTurn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/scoundrel'sTurn.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/scoundrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/scoundrel.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/scoundrelPP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/scoundrelPP.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/scoundrelWin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/scoundrelWin.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/send.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/sendPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/sendPressed.png -------------------------------------------------------------------------------- /Resources/NetworkGameScene/yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/NetworkGameScene/yes.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/baby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/baby.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/back.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/bar.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/bg.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/confirm.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/confirmPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/confirmPressed.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/radioOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/radioOff.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/radioOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/radioOn.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/referee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/referee.png -------------------------------------------------------------------------------- /Resources/SelectRoleScene/scoundrel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SelectRoleScene/scoundrel.png -------------------------------------------------------------------------------- /Resources/SignInScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignInScene/bg.png -------------------------------------------------------------------------------- /Resources/SignInScene/btnBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignInScene/btnBg.png -------------------------------------------------------------------------------- /Resources/SignInScene/editBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignInScene/editBox.png -------------------------------------------------------------------------------- /Resources/SignInScene/editBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignInScene/editBoxPressed.png -------------------------------------------------------------------------------- /Resources/SignUpScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignUpScene/bg.png -------------------------------------------------------------------------------- /Resources/SignUpScene/editBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignUpScene/editBox.png -------------------------------------------------------------------------------- /Resources/SignUpScene/editBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/SignUpScene/editBoxPressed.png -------------------------------------------------------------------------------- /Resources/WaitingNetworkGameScene/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/WaitingNetworkGameScene/back.png -------------------------------------------------------------------------------- /Resources/WaitingNetworkGameScene/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/WaitingNetworkGameScene/bg.png -------------------------------------------------------------------------------- /Resources/WaitingNetworkGameScene/notReady.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/WaitingNetworkGameScene/notReady.png -------------------------------------------------------------------------------- /Resources/WaitingNetworkGameScene/ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/WaitingNetworkGameScene/ready.png -------------------------------------------------------------------------------- /Resources/Ybutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/Ybutton.png -------------------------------------------------------------------------------- /Resources/Ybutton1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/Ybutton1.png -------------------------------------------------------------------------------- /Resources/ZOO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/ZOO.png -------------------------------------------------------------------------------- /Resources/aaa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/aaa.png -------------------------------------------------------------------------------- /Resources/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/back.png -------------------------------------------------------------------------------- /Resources/backmusic.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/backmusic.mp3 -------------------------------------------------------------------------------- /Resources/backmusic1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/backmusic1.mp3 -------------------------------------------------------------------------------- /Resources/backmusic2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/backmusic2.mp3 -------------------------------------------------------------------------------- /Resources/backmusic3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/backmusic3.mp3 -------------------------------------------------------------------------------- /Resources/bghuang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/bghuang.png -------------------------------------------------------------------------------- /Resources/bgr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/bgr.png -------------------------------------------------------------------------------- /Resources/bird1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/bird1.png -------------------------------------------------------------------------------- /Resources/btn_start1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/btn_start1.png -------------------------------------------------------------------------------- /Resources/btn_start2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/btn_start2.png -------------------------------------------------------------------------------- /Resources/buddy_1.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | buddy_1_1.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {44,62} 15 | spriteSourceSize 16 | {44,62} 17 | textureRect 18 | {{0,0},{44,62}} 19 | textureRotated 20 | 21 | 22 | buddy_1_2.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {45,60} 30 | spriteSourceSize 31 | {45,60} 32 | textureRect 33 | {{44,0},{45,60}} 34 | textureRotated 35 | 36 | 37 | buddy_1_3.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {45,56} 45 | spriteSourceSize 46 | {45,56} 47 | textureRect 48 | {{89,0},{45,56}} 49 | textureRotated 50 | 51 | 52 | buddy_1_4.png 53 | 54 | aliases 55 | 56 | spriteOffset 57 | {0,0} 58 | spriteSize 59 | {45,57} 60 | spriteSourceSize 61 | {45,57} 62 | textureRect 63 | {{134,0},{45,57}} 64 | textureRotated 65 | 66 | 67 | buddy_1_5.png 68 | 69 | aliases 70 | 71 | spriteOffset 72 | {0,0} 73 | spriteSize 74 | {44,57} 75 | spriteSourceSize 76 | {44,57} 77 | textureRect 78 | {{179,0},{44,57}} 79 | textureRotated 80 | 81 | 82 | 83 | metadata 84 | 85 | format 86 | 3 87 | pixelFormat 88 | RGBA8888 89 | premultiplyAlpha 90 | 91 | realTextureFileName 92 | enermy_2.png 93 | size 94 | {223,62} 95 | smartupdate 96 | $TexturePacker:SmartUpdate:b3773d81a45f4497c29b006680e6f9ba:be70059ff1c079454ecee91c9a0801c9:2cecc2c053d9f1398e6e3373044efa3d$ 97 | textureFileName 98 | enermy_2.png 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Resources/buddy_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/buddy_1.png -------------------------------------------------------------------------------- /Resources/buddy_1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/buddy_1_1.png -------------------------------------------------------------------------------- /Resources/car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/car.png -------------------------------------------------------------------------------- /Resources/closeset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/closeset.png -------------------------------------------------------------------------------- /Resources/colidable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/colidable.png -------------------------------------------------------------------------------- /Resources/coliding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/coliding.png -------------------------------------------------------------------------------- /Resources/duihao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/duihao.png -------------------------------------------------------------------------------- /Resources/duihao1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/duihao1.png -------------------------------------------------------------------------------- /Resources/duihao2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/duihao2.png -------------------------------------------------------------------------------- /Resources/enermy_1.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | enermy_1_1.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {45,64} 15 | spriteSourceSize 16 | {45,64} 17 | textureRect 18 | {{0,0},{45,64}} 19 | textureRotated 20 | 21 | 22 | enermy_1_2.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {47,61} 30 | spriteSourceSize 31 | {47,61} 32 | textureRect 33 | {{45,0},{47,61}} 34 | textureRotated 35 | 36 | 37 | enermy_1_3.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {45,57} 45 | spriteSourceSize 46 | {45,57} 47 | textureRect 48 | {{92,0},{45,57}} 49 | textureRotated 50 | 51 | 52 | enermy_1_4.png 53 | 54 | aliases 55 | 56 | spriteOffset 57 | {0,0} 58 | spriteSize 59 | {46,59} 60 | spriteSourceSize 61 | {46,59} 62 | textureRect 63 | {{137,0},{46,59}} 64 | textureRotated 65 | 66 | 67 | enermy_1_5.png 68 | 69 | aliases 70 | 71 | spriteOffset 72 | {0,0} 73 | spriteSize 74 | {45,58} 75 | spriteSourceSize 76 | {45,58} 77 | textureRect 78 | {{183,0},{45,58}} 79 | textureRotated 80 | 81 | 82 | 83 | metadata 84 | 85 | format 86 | 3 87 | pixelFormat 88 | RGBA8888 89 | premultiplyAlpha 90 | 91 | realTextureFileName 92 | pestTypes.png 93 | size 94 | {228,64} 95 | smartupdate 96 | $TexturePacker:SmartUpdate:e386a4c59d6ee9c8d37484677cbf2618:3c349914d91d7e3f8867ee081ae5fb62:d8dd6727ffb8c63b529f0744ba451d04$ 97 | textureFileName 98 | pestTypes.png 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Resources/enermy_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_1.png -------------------------------------------------------------------------------- /Resources/enermy_1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_1_1.png -------------------------------------------------------------------------------- /Resources/enermy_2.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | enermy_2_1.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {45,63} 15 | spriteSourceSize 16 | {45,63} 17 | textureRect 18 | {{0,0},{45,63}} 19 | textureRotated 20 | 21 | 22 | enermy_2_2.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {48,63} 30 | spriteSourceSize 31 | {48,63} 32 | textureRect 33 | {{45,0},{48,63}} 34 | textureRotated 35 | 36 | 37 | enermy_2_3.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {44,60} 45 | spriteSourceSize 46 | {44,60} 47 | textureRect 48 | {{93,0},{44,60}} 49 | textureRotated 50 | 51 | 52 | enermy_2_4.png 53 | 54 | aliases 55 | 56 | spriteOffset 57 | {0,0} 58 | spriteSize 59 | {47,62} 60 | spriteSourceSize 61 | {47,62} 62 | textureRect 63 | {{137,0},{47,62}} 64 | textureRotated 65 | 66 | 67 | enermy_2_5.png 68 | 69 | aliases 70 | 71 | spriteOffset 72 | {0,0} 73 | spriteSize 74 | {45,59} 75 | spriteSourceSize 76 | {45,59} 77 | textureRect 78 | {{184,0},{45,59}} 79 | textureRotated 80 | 81 | 82 | 83 | metadata 84 | 85 | format 86 | 3 87 | pixelFormat 88 | RGBA8888 89 | premultiplyAlpha 90 | 91 | realTextureFileName 92 | enermy_2.png 93 | size 94 | {229,63} 95 | smartupdate 96 | $TexturePacker:SmartUpdate:33f6925e7c09ada1aa4cb435ac75f13a:04dd64b27fae978a0d1565344dd0b096:2cecc2c053d9f1398e6e3373044efa3d$ 97 | textureFileName 98 | enermy_2.png 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Resources/enermy_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_2.png -------------------------------------------------------------------------------- /Resources/enermy_2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_2_1.png -------------------------------------------------------------------------------- /Resources/enermy_3.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | enermy_3_1.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {41,63} 15 | spriteSourceSize 16 | {41,63} 17 | textureRect 18 | {{0,0},{41,63}} 19 | textureRotated 20 | 21 | 22 | enermy_3_2.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {49,60} 30 | spriteSourceSize 31 | {49,60} 32 | textureRect 33 | {{41,0},{49,60}} 34 | textureRotated 35 | 36 | 37 | enermy_3_3.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {43,56} 45 | spriteSourceSize 46 | {43,56} 47 | textureRect 48 | {{90,0},{43,56}} 49 | textureRotated 50 | 51 | 52 | enermy_3_4.png 53 | 54 | aliases 55 | 56 | spriteOffset 57 | {0,0} 58 | spriteSize 59 | {47,60} 60 | spriteSourceSize 61 | {47,60} 62 | textureRect 63 | {{133,0},{47,60}} 64 | textureRotated 65 | 66 | 67 | enermy_3_5.png 68 | 69 | aliases 70 | 71 | spriteOffset 72 | {0,0} 73 | spriteSize 74 | {42,57} 75 | spriteSourceSize 76 | {42,57} 77 | textureRect 78 | {{180,0},{42,57}} 79 | textureRotated 80 | 81 | 82 | 83 | metadata 84 | 85 | format 86 | 3 87 | pixelFormat 88 | RGBA8888 89 | premultiplyAlpha 90 | 91 | realTextureFileName 92 | enermy_2.png 93 | size 94 | {222,63} 95 | smartupdate 96 | $TexturePacker:SmartUpdate:3cc2741641a106b47e5ed9dc1496ffa3:ef8bfeff74d666eb074e6320cec56f63:2cecc2c053d9f1398e6e3373044efa3d$ 97 | textureFileName 98 | enermy_2.png 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Resources/enermy_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_3.png -------------------------------------------------------------------------------- /Resources/enermy_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_3_1.png -------------------------------------------------------------------------------- /Resources/enermy_4.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | enermy_4_1.png 8 | 9 | aliases 10 | 11 | spriteOffset 12 | {0,0} 13 | spriteSize 14 | {43,62} 15 | spriteSourceSize 16 | {43,62} 17 | textureRect 18 | {{0,0},{43,62}} 19 | textureRotated 20 | 21 | 22 | enermy_4_2.png 23 | 24 | aliases 25 | 26 | spriteOffset 27 | {0,0} 28 | spriteSize 29 | {48,60} 30 | spriteSourceSize 31 | {48,60} 32 | textureRect 33 | {{43,0},{48,60}} 34 | textureRotated 35 | 36 | 37 | enermy_4_3.png 38 | 39 | aliases 40 | 41 | spriteOffset 42 | {0,0} 43 | spriteSize 44 | {43,59} 45 | spriteSourceSize 46 | {43,59} 47 | textureRect 48 | {{91,0},{43,59}} 49 | textureRotated 50 | 51 | 52 | enermy_4_4.png 53 | 54 | aliases 55 | 56 | spriteOffset 57 | {0,0} 58 | spriteSize 59 | {46,60} 60 | spriteSourceSize 61 | {46,60} 62 | textureRect 63 | {{134,0},{46,60}} 64 | textureRotated 65 | 66 | 67 | enermy_4_5.png 68 | 69 | aliases 70 | 71 | spriteOffset 72 | {0,0} 73 | spriteSize 74 | {41,55} 75 | spriteSourceSize 76 | {41,55} 77 | textureRect 78 | {{180,0},{41,55}} 79 | textureRotated 80 | 81 | 82 | 83 | metadata 84 | 85 | format 86 | 3 87 | pixelFormat 88 | RGBA8888 89 | premultiplyAlpha 90 | 91 | realTextureFileName 92 | enermy_2.png 93 | size 94 | {221,62} 95 | smartupdate 96 | $TexturePacker:SmartUpdate:94d9cab15241108c6aac490621632e7e:6203cec0ddec594fc5ca109079eec0c5:2cecc2c053d9f1398e6e3373044efa3d$ 97 | textureFileName 98 | enermy_2.png 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Resources/enermy_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_4.png -------------------------------------------------------------------------------- /Resources/enermy_4_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enermy_4_1.png -------------------------------------------------------------------------------- /Resources/enter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/enter.png -------------------------------------------------------------------------------- /Resources/hosp.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | eJxdzMVOHQAARNGHu7u7FXd3p0VaoGiLW4IlaIJtkN/msHthcTZ3kgkJBAKhhBFOBJFEEU0MscQRTwKJJJFMCqmkkU4GmWSRTQ655JFPAYUUUUwJpZRRTgWVVFFNDT+opY56GmikiWZaaKWNdjropItueuilj34GGGSIYUYYZYxxJphkimlm+MkvZpljngV+84dFlljmLyusssY6G2zyj/9ssc0Ou+yxzwGHHHHMCadBzjjngsugfsU1N9xyx33Q/sAjTzzz8u33yytvvPPBJ4inI2Q= 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | eJxjYBgFuEAnFTGx5mOTHygAAN06Des= 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Resources/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/left.png -------------------------------------------------------------------------------- /Resources/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/loading.png -------------------------------------------------------------------------------- /Resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/logo.png -------------------------------------------------------------------------------- /Resources/mainMap.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | eJyF1UOwGAYQAND/f2zbtm3bSRvbrtvYtm3bttHYZhvbTvoy6aG3zuyb2cNedmd3NjAgICCIYAQnBCEJRWjCEJZwhCcCEYlEZKIQlWhEJwYxiUVs4hCXeMQnAQlJRGKSkJRkJCcFKUlFatKQlnSkJwMZyURmspCVbGQnBznJRW7ykJd85KcABSlEYYpQlGIUpwQlKUVpylCWcpSnAhWpRGWqUJVqfMf3VKcGNalFbepQl3rUpwENaURjmtCUZjSnBS1pRWva0JZ2tOcHfuQnfuYXfuU3fucPOtCRTnSmC13pRnd60JNe9KYPfelHfwYwkEEMZghDGcZwRjCSUYxmDGMZx3gmMJFJTGYKU5nGdGYwk1nMZg5zmcd8FrCQRSxmCUtZxnJWsJJVrGYNa1nHejawkU1sZgtb2cZ2drCTXexmD3vZx34OcJA/OcRhjnCUYxznBCc5xWnOcJZznOcCF7nEZa5wlWtc5wY3ufUft7nDXe5xnwc85BGPecJTnvGcF7zkFa95w1ve8Z4PfOQTn/lCQKAgiGAEJwQhCUVowhCWcIQnAhGJRGSiEJVoRCcGMYlFbOIQl3jEJwEJSURikpCUZCQnBSlJRWrSkJZ0pCcDGclEZrKQlWxkJwc5yUVu8pCXfOSnAAUpRGGKUJRiFKcEJSlFacpQlnKUpwIVqURlqlCVal97DPqmurwGNalFbepQl3rUpwENaURjmtCUZjSnBS1pRWva0JZ2tA/8tpP/p4O6jnSiM13oSje604Oe9KI3fehLP/ozgIEMYjBDGMowhjOCkYxiNGMYyzjGM4GJTGIyU5jKNKYzg5nMYjZzmMs85rOAhSxiMUtYyjKWs4KVrGI1a1jLOtazgY1sYjNb2Mo2trODnexiN3vYyz72c4CDX2fNIQ5zhKMc4zgnOMkpTnOGs5zjPBe4yCUuc4WrXOM6N7jJX/zNLW5zh7vc4z4PeMgjHvOEpzzjOS94ySte84a3vOM9H/jIJz7zha+PP5AgghGcEIQkFKEJQ1jCEZ4IRCQSkYlCVKIRnRjEJBaxiUPcf+8iPv8AmQkEeA== 25 | 26 | 27 | 28 | 29 | eJzt00dPVUEUAODne6grW2JvP8L+o+y9L2wLuyiKFdvC3ugdQak2ekfAvlJ6U/AjIZEQngtkZTjJl5kzM/ecyb25gcBE/M8RFfwzjw6GPxfzl72xRKx6ccSTQCJJJJNCKmmkk0EmWUN3yDbm8IKX5JJHPgUUUhTmvsXWSyiljHIqqKSKamqopY56GoZqNRqbaOYDH/nEZ77wlW9h+n63/oMWWmmjnQ466aKbHnrpG1an33xgMA8FApMIEiKCyUxhamj0vtOsT2cGM5kV5txEjH+s9a7XsZ4NbGQTm9nCVraxnR3sZBe72cNe9rF/xDc7ID/IIQ5zZMT+UfkxjnOCk5ziNGeI5CzniOI8F4jmIpe4zBWuco0YrnODm9zi9oi+d+R3ucd9HvCQRzzmCU95RixxxJNAIkkkk0IqaaSTQSZZPCebnGG9c83zyKeAQop4xWve8JZ3FFNCKWWUU0ElVVRTQy111NPAexppovkf/qEWz7bSRjsddNJFNz300sdPftHPwGDPiLH3HS1mqzeHucxjPgtYyCIWs4Sl49x3mXrLWcFKVrGaNfwGRU2Rwg== 30 | 31 | 32 | 33 | 34 | eJzt0NlKQkEcx/HJ0xuk0FVRT5CKtpjagl22WLZamaWX2mXm2gKGVpdFtlCBtj5GPUkv0jcYSKTTQQXnxj98+B/mPzO/4QjRrmYrZhIijl3T//v2mCewjyRSSCODLHLy/CH9CMc69xVYL+IUZzg3yL1gfin3XNFLuMYNbnEnZ/f0BzxW3Vfmu4InPOMFr3jDu0Fuu9RVlyaEGRbtd61b+3tvD+u9ctZH79fZZ1QDnLPCBru8w0F3YhBDGMYIXBiFGx54MYZxTGBSnvfRpwzeM818BrOYgx/zWEAAi1jCMlawijUEsY4NbCKELYSxjR1EEG3wf9RTWTJyONDJyrN+0oJ31FaZzIqC3J/6IPdTUfaXotyOTjW5rapvFQErtA== 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | eJxjYEAAKxYIpgeA2YVsH7IYrTC9/UZPe7HZP1D2UhI/pMYjte2FsbH5j5r2YjOX2HQ7GNM2rdxATPjRolygh72kmEsre0kJm4G0mxppZiDsJsVttATE2klJGBFSDwD9yUSL 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Resources/mianban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/mianban.png -------------------------------------------------------------------------------- /Resources/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/ok.png -------------------------------------------------------------------------------- /Resources/out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/out.png -------------------------------------------------------------------------------- /Resources/quan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/quan.png -------------------------------------------------------------------------------- /Resources/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/right.png -------------------------------------------------------------------------------- /Resources/school.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/school.png -------------------------------------------------------------------------------- /Resources/school.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | eJwNwwc3FgAAAMDP3jN7ZSabrLKzC9l7r8om2WUk/G13711QIBAINsRQwww3wkijjDbGWOOMN8FEk0z2jSmmmma6GWaaZbY55prnW/MtsNAiiy3xnaW+t8xyK6y0ymprrLXOD9bbYKNNNvvRT7bYapvtdthpl5/ttsde++x3wEG/+NUhhx3xm6OOOe6Ek0457YyzzjnvgosuueyKq6657oabbrntd3/40x133XPfAw898tgTf3nqb88898JLr7z2xj/+9dY7733wn4/+98lnX3wFmeMj3Q== 17 | 18 | 19 | 20 | 21 | eJxjYBgFnQOMCblnoAAAroUTRQ== 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Resources/setbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/setbg.png -------------------------------------------------------------------------------- /Resources/shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/shop.png -------------------------------------------------------------------------------- /Resources/shop.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | eJwNwwc3FgAAAMDP3jN7ZSabrLKzC9l7r8om2WUk/G13711QIBAINsRQwww3wkijjDbGWOOMN8FEk0z2jSmmmma6GWaaZbY55prnW/MtsNAiiy3xnaW+t8xyK6y0ymprrLXOD9bbYKNNNvvRT7bYapvtdthpl5/ttsde++x3wEG/+NUhhx3xm6OOOe6Ek0457YyzzjnvgosuueyKq6657oabbrntd3/40x133XPfAw898tgTf3nqb88898JLr7z2xj/+9dY7733wn4/+98lnX3wFmeMj3Q== 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | eJxjYBiZoJMAJkcPKZgU8wcKAABxphGq 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Resources/solo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/solo.png -------------------------------------------------------------------------------- /Resources/solo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/solo1.png -------------------------------------------------------------------------------- /Resources/solo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/solo2.png -------------------------------------------------------------------------------- /Resources/text.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | play1 4 | 开始游戏 5 | play2 6 | 当前分: 7 | play3 8 | 最高分: 9 | play4 10 | 打飞机大战 11 | play5 12 | 请选择战斗机型号并设置背景音乐 13 | select 14 | Choose Ok? Begin! 15 | suspend 16 | 暂停 17 | scoreMenu 18 | 得分纪录 19 | back_game 20 | 回到游戏 21 | back_menu 22 | 回到主页 23 | game_win 24 | 游戏胜利 25 | regame 26 | 再玩一次? 27 | -------------------------------------------------------------------------------- /Resources/walk.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | walk_1.png 8 | 9 | frame 10 | {{2,126},{60,60}} 11 | offset 12 | {0,0} 13 | rotated 14 | 15 | sourceColorRect 16 | {{0,0},{60,60}} 17 | sourceSize 18 | {60,60} 19 | 20 | walk_2.png 21 | 22 | frame 23 | {{64,64},{60,60}} 24 | offset 25 | {0,0} 26 | rotated 27 | 28 | sourceColorRect 29 | {{0,0},{60,60}} 30 | sourceSize 31 | {60,60} 32 | 33 | walk_3.png 34 | 35 | frame 36 | {{2,64},{60,60}} 37 | offset 38 | {0,0} 39 | rotated 40 | 41 | sourceColorRect 42 | {{0,0},{60,60}} 43 | sourceSize 44 | {60,60} 45 | 46 | walk_4.png 47 | 48 | frame 49 | {{64,2},{60,60}} 50 | offset 51 | {0,0} 52 | rotated 53 | 54 | sourceColorRect 55 | {{0,0},{60,60}} 56 | sourceSize 57 | {60,60} 58 | 59 | walk_5.png 60 | 61 | frame 62 | {{2,2},{60,60}} 63 | offset 64 | {0,0} 65 | rotated 66 | 67 | sourceColorRect 68 | {{0,0},{60,60}} 69 | sourceSize 70 | {60,60} 71 | 72 | 73 | metadata 74 | 75 | format 76 | 2 77 | realTextureFileName 78 | walk.png 79 | size 80 | {128,256} 81 | smartupdate 82 | $TexturePacker:SmartUpdate:949059dfc61c633be445d160ddc66c99$ 83 | textureFileName 84 | walk.png 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Resources/walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/walk.png -------------------------------------------------------------------------------- /Resources/walk_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/walk_1.png -------------------------------------------------------------------------------- /Resources/yaogandi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/yaogandi.png -------------------------------------------------------------------------------- /Resources/yaogandian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/yaogandian.png -------------------------------------------------------------------------------- /Resources/yuan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/Resources/yuan.png -------------------------------------------------------------------------------- /Resources/zoo.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | eJzFy0VCAgEAAMC1xUIUExUMDGwM7ALsxg7E1v9/wPmFhzlOWRAE5VRQSRXV1FBLiDrqaaCRJsI0E6GFVqK00U4HnXTRTYweeukjToJ+BhhkiCTDjDDKGCnGmWCSKaaZYZY0c8yzwCIZllhmhVXWWGeDTbbYZocsOfLsssc+BxxyxDEnnHLGORdcUuCKa2645Y57HnjkiWeKvFDilTfe+eCTL7754fcf7x8QxyE6 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | eJztyLkNgDAABEHXy5vwYxwZaJsJiBAFELDSSKcL4e/rFZRU1DS0L7ujZ2BkYmZhJbKR7v38MzsHJxdCnQ32 30 | 31 | 32 | 33 | 34 | eJxjYBh6oHOA8FAElPgXAPSdGBY= 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Server/.gitignore: -------------------------------------------------------------------------------- 1 | /configuration.js -------------------------------------------------------------------------------- /Server/baby's 36 skills.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : MySQL 5 | Source Server Type : MySQL 6 | Source Server Version : 80016 7 | Source Host : localhost:3306 8 | Source Schema : baby's 36 skills 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 80016 12 | File Encoding : 65001 13 | 14 | Date: 21/06/2019 08:39:32 15 | */ 16 | 17 | SET NAMES utf8mb4; 18 | SET FOREIGN_KEY_CHECKS = 0; 19 | 20 | -- ---------------------------- 21 | -- Table structure for accounts 22 | -- ---------------------------- 23 | DROP TABLE IF EXISTS `accounts`; 24 | CREATE TABLE `accounts` ( 25 | `username` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, 26 | `password` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, 27 | PRIMARY KEY (`username`) USING BTREE 28 | ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; 29 | 30 | -- ---------------------------- 31 | -- Table structure for players 32 | -- ---------------------------- 33 | DROP TABLE IF EXISTS `players`; 34 | CREATE TABLE `players` ( 35 | `ID` int(10) NOT NULL, 36 | `child_win` int(10) NOT NULL, 37 | `child_lost` int(10) NOT NULL, 38 | `scoundrel_win` int(10) NOT NULL, 39 | `scoundrel_lost` int(10) NOT NULL, 40 | `supervisor_plays` int(10) NOT NULL, 41 | PRIMARY KEY (`ID`) USING BTREE 42 | ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; 43 | 44 | -- ---------------------------- 45 | -- Table structure for rooms 46 | -- ---------------------------- 47 | DROP TABLE IF EXISTS `rooms`; 48 | CREATE TABLE `rooms` ( 49 | `id` int(10) NOT NULL AUTO_INCREMENT, 50 | `name` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, 51 | `password` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 52 | `user1_nickname` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 53 | `user1_identity` char(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 54 | `user2_nickname` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 55 | `user2_identity` char(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 56 | `user3_nickname` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 57 | `user3_identity` char(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, 58 | PRIMARY KEY (`id`) USING BTREE 59 | ) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; 60 | 61 | SET FOREIGN_KEY_CHECKS = 1; 62 | -------------------------------------------------------------------------------- /Server/createRoom.js: -------------------------------------------------------------------------------- 1 | exports.callback = function createRoomCallback(msg, conn, room) 2 | { 3 | let msgBack = {"event": 5} 4 | let nm = msg["nm"] 5 | let pw = msg["pw"] 6 | let creator = msg["creator"] 7 | console.log(room) 8 | if(nm == ''){ msgBack['status'] = 520 } 9 | else if('creator' in room) {msgBack['status'] = 530} 10 | if('status' in msgBack){conn.send(JSON.stringify(msgBack))} 11 | else{ createRoom(conn, nm, pw, creator, msgBack, room) } 12 | } 13 | 14 | function createRoom(conn, nm, pw, creator, msgBack, room) 15 | { 16 | room["nm"] = nm 17 | room["creator"] = creator 18 | room["pw"] = pw 19 | msgBack['status'] = 531 20 | conn.send(JSON.stringify(msgBack)) 21 | console.log(room) 22 | } -------------------------------------------------------------------------------- /Server/db.js: -------------------------------------------------------------------------------- 1 | const mysql = require('mysql') 2 | const conf = require('./configuration') 3 | 4 | console.log("\n正在初始化连接数据库") 5 | 6 | var db = mysql.createConnection({host:conf.host, user:conf.user, password:conf.password, database:conf.database}) 7 | 8 | exports.q = function q(cmd, callback, errcallback) 9 | { 10 | data = db.query(cmd, function(err, data) 11 | { 12 | //console.log("cmd:",cmd) 13 | if(err) 14 | { 15 | console.log("err:", err) 16 | errcallback(err) 17 | } 18 | else 19 | { 20 | //console.log("data", data) 21 | callback(data) 22 | } 23 | }) 24 | } 25 | 26 | 27 | exports.t = function truncateTable(tableName) 28 | { 29 | q('TRUNCATE TABLE ' + tableName 30 | ,function(data){console.log('已清空' + tableName + '表')} 31 | , function(err){}) 32 | } 33 | 34 | // var id = '1' 35 | // id = '1 OR 1=1' 36 | // var cmd = 'SELECT * FROM account WHERE ID=' + id 37 | // cmd = 'SELECT * FROM account WHERE ID=' + escape(id) 38 | //db.end() 39 | console.log("初始化连接数据库完毕\n") -------------------------------------------------------------------------------- /Server/dialog.js: -------------------------------------------------------------------------------- 1 | var waiting = require("./waiting") 2 | 3 | exports.callback = function selectRoleCallback(msg, conn, room) 4 | { 5 | 6 | if('quit' in msg){ 7 | dialogCloseCallback(conn, room) 8 | return 9 | } 10 | 11 | let msgBack = {"event": 9} 12 | if('result' in msg && 'refereeWS' in room && room['refereeWS'] == conn){ 13 | msgBack['result'] = msg['result'] 14 | msgBack['status'] = 951 15 | waiting.sendMsg(conn, room, msgBack) 16 | safelyClearRoom(room) 17 | return 18 | } 19 | if('turn' in room){ 20 | if('msg' in msg){ 21 | msgBack['msg'] = msg['msg'] 22 | transpond(conn, room, msgBack) 23 | return 24 | } 25 | else if('end' in msg){ room['turn'] = (room['turn'] + 1) % 3 } 26 | } 27 | else{ room['turn'] = 0 } 28 | if(room['turn'] == 0){ msgBack['status'] = 921 } 29 | else if(room['turn'] == 1){ msgBack['status'] = 931 } 30 | else if(room['turn'] == 2){ msgBack['status'] = 941 } 31 | waiting.sendMsg(conn, room, msgBack) 32 | } 33 | 34 | function transpond(conn, room, msgBack) 35 | { 36 | if(room['turn'] == 0){ msgBack['status'] = 961 } 37 | else if(room['turn'] == 1){ msgBack['status'] = 971 } 38 | else if(room['turn'] == 2){ msgBack['status'] = 981 } 39 | waiting.sendMsg(conn, room, msgBack) 40 | } 41 | 42 | 43 | function dialogCloseCallback(conn, room) 44 | { 45 | let msgBack = {"event": 9} 46 | msgBack['status'] = 951 47 | if(room['childWS'] == conn){ msgBack['result'] = 'babyLose'} 48 | else if(room['refereeWS'] == conn){ msgBack['result'] = 'refereeLose'} 49 | else if(room['scoundrelWS'] == conn){ msgBack['result'] = 'scoundrelLose'} 50 | waiting.sendMsg(conn, room, msgBack) 51 | safelyClearRoom(room) 52 | } 53 | 54 | exports.closeCB = dialogCloseCallback 55 | 56 | function safelyClearRoom(room){ 57 | if('childWS' in room){ delete room['childWS'] } 58 | if('child' in room){ delete room['child'] } 59 | if('scoundrelWS' in room){ delete room['scoundrelWS'] } 60 | if('scoundrel' in room){ delete room['scoundrel'] } 61 | if('refereeWS' in room){ delete room['refereeWS'] } 62 | if('referee' in room){ delete room['referee'] } 63 | } -------------------------------------------------------------------------------- /Server/getRooms.js: -------------------------------------------------------------------------------- 1 | exports.callback = function getRoomsCallback(conn, room) 2 | { 3 | let msgBack = {"event": 4} 4 | if('nm' in room){msgBack['nm'] = room["nm"] 5 | msgBack['creator'] = room["creator"] 6 | msgBack['status'] = 411 7 | } 8 | else{ msgBack['status'] = 420 } 9 | conn.send(JSON.stringify(msgBack)) 10 | } -------------------------------------------------------------------------------- /Server/joinRoom.js: -------------------------------------------------------------------------------- 1 | exports.callback = function joinRoomCallback(msg, conn, room) 2 | { 3 | let msgBack = {"event": 6} 4 | let nm = msg["nm"] 5 | let pw = msg["pw"] 6 | if(nm == ''){ msgBack['status'] = 620 } 7 | else if(nm != room['nm']){msgBack['status'] = 630} 8 | else if(pw != room['pw']){msgBack['status'] = 640} 9 | if('status' in msgBack){conn.send(JSON.stringify(msgBack))} 10 | else{ joinRoom(conn, msgBack, room) } 11 | } 12 | 13 | function joinRoom(conn, msgBack, room) 14 | { 15 | msgBack['status'] = 641 16 | conn.send(JSON.stringify(msgBack)) 17 | console.log(room) 18 | } -------------------------------------------------------------------------------- /Server/required.txt: -------------------------------------------------------------------------------- 1 | 为了减小开销,用的全局包 2 | 3 | 为了方便使用可以新建一个系统变量,如:NODE_PATH=F:/Green Program/node/node_modules 4 | 默认下node.js会在NODE_PATH和目前js所在项目下的node_modules文件夹下去寻找模块 5 | 每个项目独立安装,这样方便整个项目的复制到不同的开发机,不用安装多次。 6 | 7 | Windows 下在环境变量的“系统变量”中,新建一个名为NODE_PATH的变量,变量值为本机全局包安装的路径,如:F:/Green Program/node/node_modules(默认情况下为node.js的安装路径里的node_modules目录,也可以通过npm root -g命令查看)。 8 | 9 | 然后运行以下命令安装所需的包(全局): 10 | npm install -g mysql 11 | npm install -g nodejs-websocket 12 | 13 | 更新包: 14 | npm install -g npm-check-updates -------------------------------------------------------------------------------- /Server/selectRole.js: -------------------------------------------------------------------------------- 1 | exports.callback = function selectRoleCallback(msg, conn, room) 2 | { 3 | let msgBack = {"event": 7} 4 | let type = msg["type"] 5 | 6 | if(type == 0){ msgBack['status'] = 720 } 7 | else if(type == 1){ if('child' in room){msgBack['status'] = 730} } 8 | else if(type == 2){ if('referee' in room){msgBack['status'] = 730} } 9 | else if(type == 3){ if('scoundrel' in room){msgBack['status'] = 730} } 10 | 11 | if(type == 1){ if('childWS' in room && room['childWS'] == conn){ msgBack['status'] = 731} } 12 | else if(type == 2){ if('refereeWS' in room && room['refereeWS'] == conn){ msgBack['status'] = 731} } 13 | else if(type == 3){ if('scoundrelWS' in room && room['scoundrelWS'] == conn){ msgBack['status'] = 731} } 14 | 15 | if('status' in msgBack){conn.send(JSON.stringify(msgBack))} 16 | else{ 17 | let name = msg["un"] 18 | selectRole(conn, type, name, msgBack, room) 19 | } 20 | } 21 | 22 | function selectRole(conn, type, name, msgBack, room) 23 | { 24 | if(type == 1){ 25 | room['child'] = name 26 | room['childWS'] = conn 27 | msgBack['status'] = 731 28 | } 29 | else if(type == 2){ 30 | room['referee'] = name 31 | room['refereeWS'] = conn 32 | msgBack['status'] = 731 33 | } 34 | else if(type == 3){ 35 | room['scoundrel'] = name 36 | room['scoundrelWS'] = conn 37 | msgBack['status'] = 731 38 | } 39 | conn.send(JSON.stringify(msgBack)) 40 | } -------------------------------------------------------------------------------- /Server/signIn.js: -------------------------------------------------------------------------------- 1 | var db = require("./db") 2 | 3 | exports.callback = function signUpCallback(msg, conn) 4 | { 5 | let msgBack = {"event": 2} 6 | let un = msg["un"] 7 | let pw = msg["pw"] 8 | if(un == ''){ msgBack['status'] = 220 } 9 | else if(pw == ''){ msgBack['status'] = 230} 10 | if('status' in msgBack){conn.send(JSON.stringify(msgBack))} 11 | else{ signIn(conn, un, pw, msgBack) } 12 | } 13 | 14 | function signIn(conn, un, pw, msgBack) 15 | { 16 | db.q("SELECT `password` FROM accounts where `username` = '" + escape(un) + "'" 17 | , function(data){ 18 | if(data.length==1){ 19 | if(data[0]['password'] == pw){msgBack['status'] = 271} 20 | else{msgBack['status'] = 270} 21 | conn.send(JSON.stringify(msgBack)) 22 | } 23 | else{ 24 | if(data.length==0){ msgBack['status'] = 240 } 25 | else{msgBack['status'] = 250} 26 | conn.send(JSON.stringify(msgBack)) 27 | } 28 | } 29 | , function(err){ 30 | msgBack['status'] = 260 31 | conn.send(JSON.stringify(msgBack)) 32 | }) 33 | } -------------------------------------------------------------------------------- /Server/signUp.js: -------------------------------------------------------------------------------- 1 | var db = require("./db") 2 | 3 | // db.t('accounts') 4 | // db.t('players') 5 | // db.t('rooms') 6 | 7 | exports.callback = function signUpCallback(msg, conn) 8 | { 9 | let msgBack = {"event": 3} 10 | let un = msg["un"] 11 | let pw = msg["pw"] 12 | if(un == ''){ msgBack['status'] = 320 } 13 | else if(pw == ''){ msgBack['status'] = 350} 14 | if('status' in msgBack){conn.send(JSON.stringify(msgBack))} 15 | else{ signUp(conn, un, pw, msgBack) } 16 | } 17 | 18 | function signUp(conn, un, pw, msgBack) 19 | { 20 | db.q("SELECT * FROM accounts where `username` = '" + escape(un) + "'" 21 | , function(data){ 22 | console.log(data.length, data) 23 | if(data.length==0){ insertSignUpData(conn, un, pw, msgBack) } 24 | else{ 25 | msgBack['status'] = 360 26 | conn.send(JSON.stringify(msgBack)) 27 | } 28 | } 29 | , function(err){ 30 | console.log(err) 31 | msgBack['status'] = 370 32 | conn.send(JSON.stringify(msgBack)) 33 | }) 34 | } 35 | 36 | function insertSignUpData(conn, un, pw, msgBack) 37 | { 38 | db.q("INSERT INTO accounts VALUES ('" + escape(un) + "', '" + escape(pw) + "')" 39 | , function(){ 40 | msgBack['status'] = 381 41 | conn.send(JSON.stringify(msgBack)) 42 | } 43 | ,function(){ 44 | msgBack['status'] = 380 45 | conn.send(JSON.stringify(msgBack)) 46 | } 47 | ) 48 | } -------------------------------------------------------------------------------- /Server/test/SocketApp.js: -------------------------------------------------------------------------------- 1 | var port = 80 2 | var io = require('socket.io').listen(port) 3 | console.log('Server on port ' + port.toString() + '.') 4 | var idList = [] 5 | 6 | io.sockets.on('connection', function (socket){ 7 | idList.push(socket.id) 8 | console.log(idList) 9 | //向客户端发送消息 10 | socket.send('Hello Cocos2d-x, I am Node.js') 11 | 12 | //注册客户端消息 13 | socket.on('message', function (data){ 14 | console.log("msg:", data) 15 | for(var i=0; i= Build.VERSION_CODES.P) { 49 | // Enable rendering into the cutout area 50 | WindowManager.LayoutParams lp = getWindow().getAttributes(); 51 | lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; 52 | getWindow().setAttributes(lp); 53 | } 54 | // DO OTHER INITIALIZATION BELOW 55 | 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /proj.android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | jcenter() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.1.0' 11 | 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } -------------------------------------------------------------------------------- /proj.android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # Android SDK version that will be used as the compile project 21 | PROP_COMPILE_SDK_VERSION=28 22 | 23 | # Android SDK version that will be used as the earliest version of android this application can run on 24 | PROP_MIN_SDK_VERSION=16 25 | 26 | # Android SDK version that will be used as the latest version of android this application has been tested on 27 | PROP_TARGET_SDK_VERSION=28 28 | 29 | 30 | # List of CPU Archtexture to build that application with 31 | # Available architextures (armeabi-v7a | arm64-v8a | x86) 32 | # To build for multiple architexture, use the `:` between them 33 | # Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 34 | PROP_APP_ABI=armeabi-v7a 35 | 36 | # android native code build type 37 | # none, native code will never be compiled. 38 | # cmake, native code will be compiled by CMakeLists.txt 39 | # ndk-build, native code will be compiled by Android.mk 40 | PROP_BUILD_TYPE=cmake 41 | 42 | # uncomment it and fill in sign information for release mode 43 | #RELEASE_STORE_FILE=file path of keystore 44 | #RELEASE_STORE_PASSWORD=password of keystore 45 | #RELEASE_KEY_ALIAS=alias of key 46 | #RELEASE_KEY_PASSWORD=password of key -------------------------------------------------------------------------------- /proj.android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/proj.android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /proj.android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Mar 14 17:40:59 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 7 | -------------------------------------------------------------------------------- /proj.android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /proj.android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':libcocos2dx' 2 | project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx') 3 | include ':Baby_s_36_Skills' 4 | project(':Baby_s_36_Skills').projectDir = new File(settingsDir, 'app') 5 | -------------------------------------------------------------------------------- /proj.win32/.gitignore: -------------------------------------------------------------------------------- 1 | /.vs/ 2 | /Debug.win32/ 3 | /Release.win32/ -------------------------------------------------------------------------------- /proj.win32/Baby_s_36_Skills.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Baby_s_36_Skills", "Baby_s_36_Skills.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos2d\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}" 14 | EndProject 15 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librecast", "..\cocos2d\external\recast\proj.win32\librecast.vcxproj", "{41E34993-647E-4282-8384-4AB1AE31A452}" 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|Win32 = Debug|Win32 20 | Release|Win32 = Release|Win32 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 24 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 25 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 26 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 27 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32 28 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32 29 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32 30 | {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32 31 | {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32 32 | {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32 33 | {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32 34 | {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32 35 | {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Debug|Win32.ActiveCfg = Debug|Win32 36 | {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Debug|Win32.Build.0 = Debug|Win32 37 | {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Release|Win32.ActiveCfg = Release|Win32 38 | {012DFF48-A13F-4F52-B07B-F8B9D21CE95B}.Release|Win32.Build.0 = Release|Win32 39 | {41E34993-647E-4282-8384-4AB1AE31A452}.Debug|Win32.ActiveCfg = Debug|Win32 40 | {41E34993-647E-4282-8384-4AB1AE31A452}.Debug|Win32.Build.0 = Debug|Win32 41 | {41E34993-647E-4282-8384-4AB1AE31A452}.Release|Win32.ActiveCfg = Release|Win32 42 | {41E34993-647E-4282-8384-4AB1AE31A452}.Release|Win32.Build.0 = Release|Win32 43 | EndGlobalSection 44 | GlobalSection(SolutionProperties) = preSolution 45 | HideSolutionNode = FALSE 46 | EndGlobalSection 47 | EndGlobal 48 | -------------------------------------------------------------------------------- /proj.win32/Baby_s_36_Skills.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(ProjectDir)..\Resources 5 | WindowsLocalDebugger 6 | 7 | 8 | $(ProjectDir)..\Resources 9 | WindowsLocalDebugger 10 | 11 | -------------------------------------------------------------------------------- /proj.win32/build-cfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "copy_resources": [ 3 | { 4 | "from": "../Resources", 5 | "to": "" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /proj.win32/game.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #define APSTUDIO_HIDDEN_SYMBOLS 11 | #include "windows.h" 12 | #undef APSTUDIO_HIDDEN_SYMBOLS 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (U.S.) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | #ifdef _WIN32 21 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 22 | #pragma code_page(1252) 23 | #endif //_WIN32 24 | 25 | #ifdef APSTUDIO_INVOKED 26 | ///////////////////////////////////////////////////////////////////////////// 27 | // 28 | // TEXTINCLUDE 29 | // 30 | 31 | 1 TEXTINCLUDE 32 | BEGIN 33 | "resource.h\0" 34 | END 35 | 36 | #endif // APSTUDIO_INVOKED 37 | 38 | ///////////////////////////////////////////////////////////////////////////// 39 | // 40 | // Icon 41 | // 42 | 43 | // Icon with lowest ID value placed first to ensure application icon 44 | // remains consistent on all systems. 45 | GLFW_ICON ICON "res\\game.ico" 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | // 49 | // Version 50 | // 51 | 52 | VS_VERSION_INFO VERSIONINFO 53 | FILEVERSION 1,0,0,1 54 | PRODUCTVERSION 1,0,0,1 55 | FILEFLAGSMASK 0x3fL 56 | #ifdef _DEBUG 57 | FILEFLAGS 0x1L 58 | #else 59 | FILEFLAGS 0x0L 60 | #endif 61 | FILEOS 0x4L 62 | FILETYPE 0x2L 63 | FILESUBTYPE 0x0L 64 | BEGIN 65 | BLOCK "StringFileInfo" 66 | BEGIN 67 | BLOCK "040904B0" 68 | BEGIN 69 | VALUE "CompanyName", "\0" 70 | VALUE "FileDescription", "game Module\0" 71 | VALUE "FileVersion", "1, 0, 0, 1\0" 72 | VALUE "InternalName", "game\0" 73 | VALUE "LegalCopyright", "Copyright \0" 74 | VALUE "OriginalFilename", "game.exe\0" 75 | VALUE "ProductName", "game Module\0" 76 | VALUE "ProductVersion", "1, 0, 0, 1\0" 77 | END 78 | END 79 | BLOCK "VarFileInfo" 80 | BEGIN 81 | VALUE "Translation", 0x0409, 0x04B0 82 | END 83 | END 84 | 85 | ///////////////////////////////////////////////////////////////////////////// 86 | #endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 87 | -------------------------------------------------------------------------------- /proj.win32/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #include "main.h" 26 | #include "AppDelegate.h" 27 | #include "cocos2d.h" 28 | 29 | USING_NS_CC; 30 | 31 | int WINAPI _tWinMain(HINSTANCE hInstance, 32 | HINSTANCE hPrevInstance, 33 | LPTSTR lpCmdLine, 34 | int nCmdShow) 35 | { 36 | UNREFERENCED_PARAMETER(hPrevInstance); 37 | UNREFERENCED_PARAMETER(lpCmdLine); 38 | 39 | // create the application instance 40 | AppDelegate app; 41 | return Application::getInstance()->run(); 42 | } 43 | -------------------------------------------------------------------------------- /proj.win32/main.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #ifndef __MAIN_H__ 26 | #define __MAIN_H__ 27 | 28 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 29 | 30 | // Windows Header Files: 31 | #include 32 | #include 33 | 34 | // C RunTime Header Files 35 | #include "platform/CCStdC.h" 36 | 37 | #endif // __MAIN_H__ 38 | -------------------------------------------------------------------------------- /proj.win32/res/game.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/proj.win32/res/game.ico -------------------------------------------------------------------------------- /proj.win32/resource.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | //{{NO_DEPENDENCIES}} 26 | // Microsoft Visual C++ generated include file. 27 | // Used by game.RC 28 | // 29 | 30 | #define IDS_PROJNAME 100 31 | #define IDR_TESTJS 100 32 | 33 | #define ID_FILE_NEW_WINDOW 32771 34 | 35 | // Next default values for new objects 36 | // 37 | #ifdef APSTUDIO_INVOKED 38 | #ifndef APSTUDIO_READONLY_SYMBOLS 39 | #define _APS_NEXT_RESOURCE_VALUE 201 40 | #define _APS_NEXT_CONTROL_VALUE 1000 41 | #define _APS_NEXT_SYMED_VALUE 101 42 | #define _APS_NEXT_COMMAND_VALUE 32775 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /runInAndroidWithReleaseMode.bat: -------------------------------------------------------------------------------- 1 | cocos run -p android -m release -o . 2 | -------------------------------------------------------------------------------- /一键更新变动.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/一键更新变动.bat -------------------------------------------------------------------------------- /清除所有历史版本以减少仓库大小.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocos56/Baby-s_36_Skills/b6403e5c8bbad03fd19419973f894356ba8638bc/清除所有历史版本以减少仓库大小.bat --------------------------------------------------------------------------------