├── Classes ├── .DS_Store ├── ANode.cpp ├── ANode.h ├── AppDelegate.cpp ├── AppDelegate.h ├── Ball.cpp ├── Ball.h ├── GameMainScene.cpp ├── GameMainScene.h ├── HelloWorldScene.cpp ├── HelloWorldScene.h ├── MainScene.cpp ├── MainScene.h ├── ShortestPathStep.cpp └── ShortestPathStep.h ├── README.md └── Resources ├── .DS_Store ├── CloseNormal.png ├── CloseSelected.png ├── HelloWorld.png ├── background.png ├── board_bg.png ├── board_iPad.png ├── board_test.png ├── chess0.png ├── chess1.png ├── chess2.png ├── chess3.png ├── chess4.png ├── chess5.png ├── chess6.png ├── e01.png ├── e02.png ├── e03.png ├── e04.png ├── e05.png ├── e06.png ├── e07.png ├── e08.png ├── e09.png ├── e10.png ├── e11.png ├── e12.png ├── e13.png ├── e14.png ├── e15.png ├── fonts └── Marker Felt.ttf └── game_bar.png /Classes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Classes/.DS_Store -------------------------------------------------------------------------------- /Classes/ANode.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ANode.cpp 3 | // LianZhu 4 | // 5 | // Created by Ruils on 14-10-7. 6 | // 7 | // 8 | 9 | #include "ANode.h" 10 | 11 | ANode* ANode::create(int x, int y) { 12 | 13 | ANode *node = new (std::nothrow) ANode(); 14 | if (node) 15 | { 16 | node->x = x; 17 | node->y = y; 18 | node->autorelease(); 19 | return node; 20 | } 21 | CC_SAFE_DELETE(node); 22 | return nullptr; 23 | 24 | } 25 | 26 | void ANode::calF(){ 27 | F = G + H; 28 | } -------------------------------------------------------------------------------- /Classes/ANode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Node.h 3 | // LianZhu 4 | // 5 | // Created by Ruils on 14-10-7. 6 | // 7 | // 8 | 9 | #ifndef LianZhu_ANode_h 10 | #define LianZhu_ANode_h 11 | #include "cocos2d.h" 12 | USING_NS_CC; 13 | 14 | class ANode : public cocos2d::Ref 15 | { 16 | public: 17 | static ANode* create(int x, int y); 18 | //数组下标 19 | int x; 20 | int y; 21 | 22 | //for A* 23 | int F; 24 | int G; 25 | int H; 26 | void calF(); //F=G+H; 27 | ANode* parentNode = nullptr; 28 | 29 | }; 30 | #endif 31 | -------------------------------------------------------------------------------- /Classes/AppDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "MainScene.h" 3 | 4 | USING_NS_CC; 5 | 6 | AppDelegate::AppDelegate() { 7 | 8 | } 9 | 10 | AppDelegate::~AppDelegate() 11 | { 12 | } 13 | 14 | //if you want a different context,just modify the value of glContextAttrs 15 | //it will takes effect on all platforms 16 | void AppDelegate::initGLContextAttrs() 17 | { 18 | //set OpenGL context attributions,now can only set six attributions: 19 | //red,green,blue,alpha,depth,stencil 20 | GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; 21 | 22 | GLView::setGLContextAttrs(glContextAttrs); 23 | } 24 | 25 | bool AppDelegate::applicationDidFinishLaunching() { 26 | // initialize director 27 | auto director = Director::getInstance(); 28 | auto glview = director->getOpenGLView(); 29 | if(!glview) { 30 | glview = GLViewImpl::create("My Game"); 31 | director->setOpenGLView(glview); 32 | } 33 | 34 | // turn on display FPS 35 | director->setDisplayStats(true); 36 | 37 | // set FPS. the default value is 1.0/60 if you don't call this 38 | director->setAnimationInterval(1.0 / 60); 39 | 40 | // create a scene. it's an autorelease object 41 | auto scene = Main::createScene(); 42 | 43 | // run 44 | director->runWithScene(scene); 45 | 46 | return true; 47 | } 48 | 49 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too 50 | void AppDelegate::applicationDidEnterBackground() { 51 | Director::getInstance()->stopAnimation(); 52 | 53 | // if you use SimpleAudioEngine, it must be pause 54 | // SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); 55 | } 56 | 57 | // this function will be called when the app is active again 58 | void AppDelegate::applicationWillEnterForeground() { 59 | Director::getInstance()->startAnimation(); 60 | 61 | // if you use SimpleAudioEngine, it must resume here 62 | // SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); 63 | } 64 | -------------------------------------------------------------------------------- /Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef _APP_DELEGATE_H_ 2 | #define _APP_DELEGATE_H_ 3 | 4 | #include "cocos2d.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 | AppDelegate(); 15 | virtual ~AppDelegate(); 16 | 17 | virtual void initGLContextAttrs(); 18 | 19 | /** 20 | @brief Implement Director and Scene init code here. 21 | @return true Initialize success, app continue. 22 | @return false Initialize failed, app terminate. 23 | */ 24 | virtual bool applicationDidFinishLaunching(); 25 | 26 | /** 27 | @brief The function be called when the application enter background 28 | @param the pointer of the application 29 | */ 30 | virtual void applicationDidEnterBackground(); 31 | 32 | /** 33 | @brief The function be called when the application enter foreground 34 | @param the pointer of the application 35 | */ 36 | virtual void applicationWillEnterForeground(); 37 | }; 38 | 39 | #endif // _APP_DELEGATE_H_ 40 | 41 | -------------------------------------------------------------------------------- /Classes/Ball.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Ball.cpp 3 | // LianZhu 4 | // 5 | // Created by Ruils on 14-10-7. 6 | // 7 | // 8 | 9 | #include "Ball.h" 10 | USING_NS_CC; 11 | Ball* Ball::create(const std::string& filename) { 12 | 13 | Ball *sprite = new (std::nothrow) Ball(); 14 | if (sprite && sprite->initWithFile(filename)) 15 | { 16 | sprite->autorelease(); 17 | return sprite; 18 | } 19 | CC_SAFE_DELETE(sprite); 20 | return nullptr; 21 | } 22 | -------------------------------------------------------------------------------- /Classes/Ball.h: -------------------------------------------------------------------------------- 1 | // 2 | // Ball.h 3 | // LianZhu 4 | // 5 | // Created by Ruils on 14-10-7. 6 | // 7 | // 8 | 9 | #ifndef LianZhu_Ball_h 10 | #define LianZhu_Ball_h 11 | #include "cocos2d.h" 12 | USING_NS_CC; 13 | 14 | class Ball: public cocos2d::Sprite 15 | { 16 | public : 17 | static Ball* create(const std::string& filename); 18 | //数组下标 19 | int xPos; 20 | int yPos; 21 | //坐标值 22 | float x; 23 | float y; 24 | //颜色 25 | int color; 26 | //Vec2 firstBallPos = Vec2(0, 0); 27 | }; 28 | #endif 29 | -------------------------------------------------------------------------------- /Classes/GameMainScene.cpp: -------------------------------------------------------------------------------- 1 | #include "GameMainScene.h" 2 | #include "ANode.h" 3 | 4 | //5 12 21 32 45 5 | USING_NS_CC; 6 | using namespace std; 7 | 8 | Scene* GameMain::createScene() 9 | { 10 | // 'scene' is an autorelease object 11 | auto scene = Scene::create(); 12 | 13 | // 'layer' is an autorelease object 14 | auto layer = GameMain::create(); 15 | 16 | // add layer as a child to scene 17 | scene->addChild(layer); 18 | 19 | // return the scene 20 | return scene; 21 | } 22 | 23 | // on "init" you need to initialize your instance 24 | bool GameMain::init() 25 | { 26 | ////////////////////////////// 27 | // 1. super init first 28 | if ( !Layer::init() ) 29 | { 30 | return false; 31 | } 32 | 33 | Size visibleSize = Director::getInstance()->getVisibleSize(); 34 | Vec2 origin = Director::getInstance()->getVisibleOrigin(); 35 | 36 | ///////////////////////////// 37 | // 2. add a menu item with "X" image, which is clicked to quit the program 38 | // you may modify it. 39 | 40 | // add a "close" icon to exit the progress. it's an autorelease object 41 | auto closeItem = MenuItemImage::create( 42 | "CloseNormal.png", 43 | "CloseSelected.png", 44 | CC_CALLBACK_1(GameMain::menuCloseCallback, this)); 45 | 46 | closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , 47 | origin.y + closeItem->getContentSize().height/2)); 48 | 49 | // create menu, it's an autorelease object 50 | auto menu = Menu::create(closeItem, NULL); 51 | menu->setPosition(Vec2::ZERO); 52 | this->addChild(menu, 1); 53 | 54 | //init board array 55 | for (int i=0; i< LENGTH; i++){ 56 | for (int j=0; j< LENGTH; j++){ 57 | ballArray[i][j] = nullptr; 58 | } 59 | } 60 | //emptyPoints = new Vector; 61 | // add background 62 | auto bg = Sprite::create("background.png"); 63 | 64 | bg->setPosition(visibleSize.width / 2, visibleSize.height / 2); 65 | bg->setScale(visibleSize.width / bg->getContentSize().width, visibleSize.height / bg->getContentSize().height); 66 | this->addChild(bg, 0); 67 | 68 | boardBg = Sprite::create("board_bg.png"); 69 | boardBg->setPosition(visibleSize.width / 2, visibleSize.height / 2); 70 | float scale = (visibleSize.width - 10.0f) / boardBg->getContentSize().width; 71 | 72 | CCLOG("visibleSize.width = %f", visibleSize.width ); 73 | CCLOG("boardBg->getContentSize().width = %f", boardBg->getContentSize().width); 74 | CCLOG("scale = %f", scale); 75 | 76 | boardBg->setScale(scale, scale); 77 | this->addChild(boardBg, 1); 78 | 79 | auto scoreSprite = Sprite::create("game_bar.png"); 80 | float scale2 = (visibleSize.width) / scoreSprite->getContentSize().width; 81 | scoreSprite->setPosition(visibleSize.width / 2, visibleSize.height-scoreSprite->getContentSize().height); 82 | scoreSprite->setScale(scale2,scale2); 83 | this->addChild(scoreSprite, 1); 84 | 85 | maxScoreLable = LabelTTF::create("100", "Arial", 20); 86 | maxScoreLable->setColor(Color3B::YELLOW); 87 | scoreLable = LabelTTF::create("50", "Arial", 20); 88 | maxScoreLable->setColor(Color3B::YELLOW); 89 | 90 | scoreLable->addChild(maxScoreLable); 91 | scoreSprite->addChild(scoreLable); 92 | 93 | // touch 94 | auto dispatcher = Director::getInstance()->getEventDispatcher(); 95 | auto listener = EventListenerTouchAllAtOnce::create(); 96 | //listener->onTouchesEnded = CC_CALLBACK_2(GameMain::onTouchesEnded, this); 97 | listener->onTouchesBegan = CC_CALLBACK_2(GameMain::onTouchesBegan, this); 98 | dispatcher->addEventListenerWithSceneGraphPriority(listener, this); 99 | 100 | addBalls(); 101 | 102 | this->scheduleOnce((SEL_SCHEDULE)&GameMain::shootBalls, 0.5f); 103 | return true; 104 | } 105 | 106 | static Ball* colorToBall(int i) { 107 | switch (i) { 108 | case 0: return Ball::create("chess0.png"); 109 | case 1: return Ball::create("chess1.png"); 110 | case 2: return Ball::create("chess2.png"); 111 | case 3: return Ball::create("chess3.png"); 112 | case 4: return Ball::create("chess4.png"); 113 | case 5: return Ball::create("chess5.png"); 114 | case 6: return Ball::create("chess6.png"); 115 | default: 116 | return Ball::create("chess0.png"); 117 | } 118 | } 119 | 120 | 121 | void GameMain::findEmpty() { 122 | emptyPoints.clear(); 123 | for (int i=0; i< LENGTH; i++){ 124 | for (int j=0; j< LENGTH; j++) { 125 | if(ballArray[i][j] == nullptr) { 126 | emptyPoints.pushBack(ANode::create(i,j)); 127 | } 128 | } 129 | } 130 | } 131 | 132 | void GameMain::shootBalls() { 133 | findEmpty(); 134 | 135 | if (emptyPoints.size() < NUMBER) { 136 | CCLOG("GameOVer."); 137 | return; 138 | } 139 | 140 | auto ball = initballs[0]; 141 | float x = ball->getContentSize().width; 142 | float y = ball->getContentSize().height; 143 | 144 | if (firstBallPos.x == 0 || firstBallPos.y == 0) { 145 | auto size = boardBg->getContentSize(); 146 | firstBallPos.x = 2.0f*x/3.0f+1; 147 | firstBallPos.y = size.height - 2.0f*y/3.0f-6.0f; 148 | 149 | CCLOG("size.width = %f",size.width); 150 | CCLOG("size.height = %f",size.height); 151 | } 152 | 153 | //for test 154 | // for (int i=0; i< LENGTH; i++){ 155 | // for (int j=0; j< LENGTH; j++){ 156 | // auto ballx = colorToBall(CCRANDOM_0_1()*10); 157 | // ballx->setPosition(Vec2(firstBallPos.x + i*(x-2.5), firstBallPos.y-j*(y-3))); 158 | // boardBg->addChild(ballx); 159 | // } 160 | // } 161 | 162 | 163 | for (int i=0; i< NUMBER; i++) { 164 | int random = (int)(CCRANDOM_0_1() * emptyPoints.size()); 165 | auto aNode = emptyPoints.at(random); 166 | emptyPoints.erase(emptyPoints.begin()+random); 167 | CCLOG("point.x = %i", aNode->x); 168 | CCLOG("point.y = %i", aNode->y); 169 | 170 | Vec2 newVec2(firstBallPos.x + aNode->x*(x-2.5f), firstBallPos.y-aNode->y*(y-3.0f)); 171 | auto ball = initballs[i]; 172 | auto actionTo = MoveTo::create(0.5f, newVec2); 173 | ball -> runAction(actionTo); 174 | 175 | ball->xPos = aNode->x; 176 | ball->yPos = aNode->y; 177 | ball->x = newVec2.x; 178 | ball->y = newVec2.y; 179 | 180 | ballArray[(int)aNode->x][(int)aNode->y] = ball; 181 | } 182 | 183 | addBalls(); 184 | 185 | scan(); 186 | 187 | } 188 | 189 | 190 | 191 | void GameMain::addBalls() { 192 | 193 | for (int i = 0; i< NUMBER; ++i) { 194 | int color = (int)(CCRANDOM_0_1() * COLORS); 195 | CCLOG("ball %i color = %i", i, color); 196 | 197 | auto ball = colorToBall(color); 198 | ball->color = color; 199 | auto position = boardBg->getContentSize(); 200 | float x = ball->getContentSize().width; 201 | float y = ball->getContentSize().height; 202 | float startx = position.width/2 - x; 203 | ball->setPosition(startx+ i*x,y/2); 204 | initballs[i] = ball; 205 | boardBg->addChild(ball); 206 | } 207 | } 208 | 209 | void GameMain::onTouchesEnded(const vector& touches, Event* event) 210 | { 211 | Touch* touch = touches[0]; 212 | Point location = touch->getLocation(); 213 | 214 | //CCLOG("onTouchesEnded location.x=%f, location.y=%f",location.x, location.y); 215 | 216 | // Point pointInball = boardBg -> convertToNodeSpace(location); 217 | // auto ball = Sprite::create("chess0.png"); 218 | // ball->setPosition(pointInball.x, pointInball.y); 219 | // boardBg->addChild(ball, 2); 220 | } 221 | 222 | void GameMain::onTouchesBegan(const vector& touches, Event* event) 223 | { 224 | Touch* touch = touches[0]; 225 | Point location = touch->getLocation(); 226 | CCLOG("onTouchesBegan location.x=%f, location.y=%f",location.x, location.y); 227 | if (!boardBg->getBoundingBox().containsPoint(location)) { 228 | CCLOG("not in boardBG!!!!!!"); 229 | return; 230 | } 231 | 232 | Point pointInboard = boardBg->convertToNodeSpace(location); 233 | auto tempBall = initballs[0]; 234 | float x = tempBall->getContentSize().width; 235 | float y = tempBall->getContentSize().height; 236 | 237 | 238 | int xPos = (int)(((pointInboard.x-firstBallPos.x)/(x-2.5f))+0.5f); 239 | int yPos = (int)(((firstBallPos.y-pointInboard.y)/(y-3.0f))+0.5f); 240 | 241 | CCLOG("xPos=%i",xPos); 242 | CCLOG("yPos=%i",yPos); 243 | if (xPos < 0 || xPos > LENGTH -1 || yPos < 0 || yPos > LENGTH - 1) { 244 | CCLOG("Out of rang!!"); 245 | return; 246 | } 247 | 248 | auto hitBall = ballArray[xPos][yPos]; 249 | //点在某个球上 250 | if(hitBall != nullptr) { 251 | // if(sprite->getBoundingBox().containsPoint(pointInboard)) { 252 | CCLOG("Hit!!!!!!"); 253 | if (choosedBall == hitBall) { 254 | return; 255 | } 256 | if(choosedBall != nullptr){ 257 | choosedBall->stopAllActions(); 258 | choosedBall->runAction(ScaleTo::create(0.2f, 1.0f)); 259 | } 260 | choosedBall = hitBall; 261 | auto action = ScaleBy::create(0.5f, 0.6f); 262 | hitBall ->runAction(RepeatForever::create(Sequence::create(action, action->reverse(), NULL))); 263 | // } 264 | return; 265 | } 266 | 267 | //点在空白的地方,看能否移动。//A*算法 268 | if (hitBall == nullptr && choosedBall != nullptr) { 269 | ANode* start = ANode::create(choosedBall->xPos,choosedBall->yPos); 270 | ANode* end = ANode::create(xPos,yPos); 271 | 272 | CCLOG("start:%i,%i",start->x,start->y); 273 | CCLOG("end:%i,%i",end->x,end->y); 274 | 275 | openList.clear(); 276 | closeList.clear(); 277 | 278 | ANode* aNode = findPath(start,end); 279 | if (aNode != nullptr) { 280 | Vector path = Vector(); 281 | while (aNode != nullptr) { 282 | CCLOG("Path:%i,%i",aNode->x,aNode->y); 283 | path.pushBack(aNode); 284 | aNode = aNode->parentNode; 285 | } 286 | //auto array = PointArray::create(path.size()); 287 | Vector actions = Vector(); 288 | for (int i=path.size()-1; i>=0; --i) { 289 | auto n = path.at(i); 290 | actions.pushBack(MoveTo::create(0.05f, Vec2(firstBallPos.x + n->x*(x-2.5f), firstBallPos.y-n->y*(y-3.0f)))); 291 | //array->addControlPoint(Vec2(firstBallPos.x + n->x*(x-2.5f), firstBallPos.y-n->y*(y-3.0f))); 292 | 293 | } 294 | //auto csb = CardinalSplineBy::create(1, array, 1); 295 | choosedBall->xPos = end->x; 296 | choosedBall->yPos = end->y; 297 | 298 | ballArray[start->x][start->y] = nullptr; 299 | ballArray[end->x][end->y] = choosedBall; 300 | 301 | choosedBall->stopAllActions(); 302 | choosedBall->runAction(ScaleTo::create(0.2f, 1.0f)); 303 | 304 | actions.pushBack(CallFunc::create(CC_CALLBACK_0(GameMain::scanAndShoot,this))); 305 | choosedBall->runAction(Sequence::create(actions)); 306 | choosedBall = nullptr; 307 | 308 | //this->scheduleOnce((SEL_SCHEDULE)&GameMain::scanAndShoot, 0.05f*path.size()); 309 | //this->scheduleOnce((SEL_SCHEDULE)&GameMain::shootBalls, 0.05f*path.size()); 310 | } 311 | 312 | 313 | 314 | } 315 | 316 | } 317 | 318 | 319 | void GameMain::menuCloseCallback(Ref* pSender) 320 | { 321 | Director::getInstance()->popScene(); 322 | } 323 | 324 | 325 | ANode* find(Vector &nodes, ANode &aNode) { 326 | 327 | for(int i=0;ix == aNode.x) && (n->y == aNode.y)) { 330 | return n; 331 | } 332 | } 333 | 334 | return nullptr; 335 | } 336 | 337 | bool exists(Vector &nodes, ANode &aNode) { 338 | for(int i=0;ix == aNode.x) && (n->y == aNode.y)) { 341 | return true; 342 | } 343 | } 344 | return false; 345 | } 346 | 347 | bool exists(Vector &nodes, int x, int y) { 348 | for(int i=0;ix == x) && (n->y == y)) { 351 | return true; 352 | } 353 | } 354 | return false; 355 | } 356 | 357 | int calcG(ANode* start, ANode* node) { 358 | int G = GameMain::STEP; 359 | int parentG = node->parentNode != nullptr ? node->parentNode->G : 0; 360 | return G + parentG; 361 | } 362 | 363 | int calcH(ANode* end, ANode* node) { 364 | int step = abs(node->x - end->x) + abs(node->y - end->y); 365 | return step * GameMain::STEP; 366 | } 367 | 368 | void foundPoint(ANode* tempStart, ANode* node) { 369 | int G = calcG(tempStart, node); 370 | if (G < node->G) { 371 | node->parentNode = tempStart; 372 | node->G = G; 373 | node->calF(); 374 | } 375 | } 376 | 377 | 378 | 379 | void GameMain::notFoundPoint(ANode* tempStart, ANode* end, ANode* node) { 380 | node->parentNode = tempStart; 381 | node->G = calcG(tempStart, node); 382 | node->H = calcH(end, node); 383 | node->calF(); 384 | openList.pushBack(node); 385 | } 386 | 387 | ANode* GameMain::findMinFNodeInOpneList() { 388 | auto tempNode = openList.at(0); 389 | for(int i=0;iF < tempNode->F) { 392 | tempNode = n; 393 | } 394 | } 395 | return tempNode; 396 | } 397 | 398 | void GameMain::findNeighborNodes(ANode* currentNode) { 399 | neighborList.clear(); 400 | 401 | int topX = currentNode->x; 402 | int topY = currentNode->y - 1; 403 | if (canReach(topX, topY) && !exists(closeList, topX, topY)) { 404 | neighborList.pushBack(ANode::create(topX, topY)); 405 | } 406 | int bottomX = currentNode->x; 407 | int bottomY = currentNode->y + 1; 408 | if (canReach(bottomX, bottomY) && !exists(closeList, bottomX, bottomY)) { 409 | neighborList.pushBack(ANode::create(bottomX, bottomY)); 410 | } 411 | int leftX = currentNode->x - 1; 412 | int leftY = currentNode->y; 413 | if (canReach(leftX, leftY) && !exists(closeList, leftX, leftY)) { 414 | neighborList.pushBack(ANode::create(leftX, leftY)); 415 | } 416 | int rightX = currentNode->x + 1; 417 | int rightY = currentNode->y; 418 | if (canReach(rightX, rightY) && !exists(closeList, rightX, rightY)) { 419 | neighborList.pushBack(ANode::create(rightX, rightY)); 420 | } 421 | 422 | } 423 | 424 | bool GameMain::canReach(int x, int y) { 425 | if (x >= 0 && x < LENGTH && y >= 0 && y < LENGTH) { 426 | return ballArray[x][y] == nullptr; 427 | } 428 | return false; 429 | } 430 | 431 | ANode* GameMain::findPath(ANode* startNode, ANode* endNode) { 432 | 433 | 434 | openList.pushBack(startNode); 435 | 436 | while (openList.size() > 0) { 437 | 438 | ANode* currentNode = findMinFNodeInOpneList(); 439 | openList.eraseObject(currentNode); 440 | 441 | closeList.pushBack(currentNode); 442 | 443 | findNeighborNodes(currentNode); 444 | for(int i=0;icolor; 465 | } 466 | return -1; 467 | 468 | } 469 | void GameMain::scan(){ 470 | scanHorizontal(); 471 | removeBall(); 472 | scanVertical(); 473 | removeBall(); 474 | scanLeftOblique(); 475 | removeBall(); 476 | scanRightOblique(); 477 | removeBall(); 478 | 479 | 480 | } 481 | void GameMain::scanAndShoot(){ 482 | scanHorizontal(); 483 | bool b1 = removeBall(); 484 | scanVertical(); 485 | bool b2 = removeBall(); 486 | scanLeftOblique(); 487 | bool b3 = removeBall(); 488 | scanRightOblique(); 489 | bool b4 = removeBall(); 490 | if (!(b1||b2||b3||b4)) { 491 | shootBalls(); 492 | } 493 | 494 | } 495 | bool GameMain::removeBall(){ 496 | int N = removedList.size(); 497 | if (N>0) { 498 | for (int i=0; ixPos,sprite->yPos); 501 | auto animate = Animate::create(getRemoveAnimation()); 502 | auto action = Sequence::create(animate, 503 | CallFunc::create(CC_CALLBACK_0(GameMain::animationEnd,this)), 504 | nullptr); 505 | sprite->runAction(action); 506 | //CCCallFunc::create(this,callfunc_selector(xx::menuSetVisableFalse)); 507 | //sprite->setVisible(false); 508 | 509 | } 510 | //removedList.clear(); 511 | return true; 512 | } 513 | return false; 514 | } 515 | void GameMain::animationEnd(){ 516 | for (int i=0; isetVisible(false); 519 | } 520 | removedList.clear(); 521 | } 522 | 523 | void GameMain::scanVertical(){ 524 | CCLOG("scanVertical"); 525 | for (int i=0; i< LENGTH; i++){ 526 | for (int j=0; j< LENGTH; j++){ 527 | int color = getColor(i,j); 528 | if (color != -1) { 529 | if (j > 0) { 530 | if (color == getColor(i,j - 1)) { 531 | continue; 532 | } 533 | } 534 | for (int k=j; k 4) { 537 | CCLOG("scanVertical find1!!"); 538 | for(int m=j;m= 4) { 547 | CCLOG("scanVertical find2!!"); 548 | for(int m=j;m 0) { 567 | if (color == getColor(j-1,i)) { 568 | continue; 569 | } 570 | } 571 | for (int k=j; k 4) { 574 | CCLOG("scanHorizontal find1!!"); 575 | for(int m=j;m= 4) { 584 | CCLOG("scanHorizontal find2!!"); 585 | for(int m=j;m 0 && j+n > 0) { 605 | if (color == getColor(i+n-1,j+n-1)) { 606 | continue; 607 | } 608 | } 609 | 610 | for (int k=0; i+n+k 4) { 613 | CCLOG("scanLeftOblique find1!!"); 614 | for(int m=0;m= 4) { 623 | CCLOG("scanLeftOblique find2!!"); 624 | for(int m=0;m<=k;m++) { 625 | removedList.pushBack(ballArray[i+n+m][j+n+m]); 626 | ballArray[i+n+m][j+n+m]=nullptr; 627 | } 628 | } 629 | } 630 | } 631 | 632 | } 633 | 634 | } 635 | } 636 | 637 | 638 | 639 | 640 | for (int i=0,j=1; j 0 && j+n > 0) { 645 | if (color == getColor(i+n-1,j+n-1)) { 646 | continue; 647 | } 648 | } 649 | 650 | for (int k=0; i+n+k 4) { 653 | CCLOG("scanLeftOblique find3!!"); 654 | for(int m=0;m= 4) { 663 | CCLOG("scanLeftOblique find4!!"); 664 | for(int m=0;m<=k;m++) { 665 | removedList.pushBack(ballArray[i+n+m][j+n+m]); 666 | ballArray[i+n+m][j+n+m]=nullptr; 667 | } 668 | } 669 | } 670 | } 671 | 672 | } 673 | 674 | } 675 | } 676 | 677 | 678 | 679 | 680 | } 681 | //从(8,0) 右至左,上至下 682 | void GameMain::scanRightOblique(){ 683 | 684 | for (int i=LENGTH-1,j=0; i>=0; i--,j=0) { 685 | for (int n=0; i-n>=0&&j+n 0) { 689 | if (color == getColor(i-n+1,j-n-1)) { 690 | continue; 691 | } 692 | } 693 | 694 | for (int k=0; i-n-k>=0 && j+n+k 4) { 697 | CCLOG("scanRightOblique find1!!"); 698 | for(int m=0;m= 4) { 707 | CCLOG("scanRightOblique find2!!"); 708 | for(int m=0;m<=k;m++) { 709 | removedList.pushBack(ballArray[i-n-m][j+n+m]); 710 | ballArray[i-n-m][j+n+m]=nullptr; 711 | } 712 | } 713 | } 714 | } 715 | 716 | } 717 | 718 | } 719 | } 720 | 721 | 722 | 723 | for (int i=LENGTH-1,j=0; j=0&&j+n 0) { 728 | if (color == getColor(i-n+1,j-1)) { 729 | continue; 730 | } 731 | } 732 | 733 | for (int k=0; i-n-k>=0 && j+n+k 4) { 736 | CCLOG("scanRightOblique find3!!"); 737 | for(int m=0;m= 4) { 746 | CCLOG("scanRightOblique find4!!"); 747 | for(int m=0;m<=k;m++) { 748 | removedList.pushBack(ballArray[i-n-m][j+n+m]); 749 | ballArray[i-n-m][j+n+m]=nullptr; 750 | } 751 | } 752 | } 753 | } 754 | 755 | } 756 | 757 | } 758 | } 759 | 760 | 761 | } 762 | 763 | Animation* GameMain::getRemoveAnimation() { 764 | auto animationCache = AnimationCache::getInstance(); 765 | auto animation = animationCache->getAnimation("removeAnimation"); 766 | if (animation == nullptr) { 767 | animation = Animation::create(); 768 | for( int i=1;i<=15;i++) 769 | { 770 | char szName[10] = {0}; 771 | sprintf(szName, "e%02d.png", i); 772 | animation->addSpriteFrameWithFile(szName); 773 | } 774 | // should last 0.9 seconds. And there are 15 frames. 775 | animation->setDelayPerUnit(0.9f / 15.0f); 776 | //animation->setRestoreOriginalFrame(true); 777 | animationCache->addAnimation(animation, "removeAnimation"); 778 | } 779 | return animation; 780 | } 781 | 782 | 783 | 784 | 785 | 786 | -------------------------------------------------------------------------------- /Classes/GameMainScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __GameMain_SCENE_H__ 2 | #define __GameMain_SCENE_H__ 3 | 4 | #include "cocos2d.h" 5 | #include "Ball.h" 6 | #include "ANode.h" 7 | 8 | 9 | USING_NS_CC; 10 | class GameMain : public cocos2d::Layer 11 | { 12 | public: 13 | static const int LENGTH = 9; 14 | static const int NUMBER = 3; 15 | static const int COLORS = 7; 16 | static const int STEP = 10; 17 | // there's no 'id' in cpp, so we recommend returning the class instance pointer 18 | static cocos2d::Scene* createScene(); 19 | 20 | // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone 21 | virtual bool init(); 22 | 23 | // a selector callback 24 | void menuCloseCallback(cocos2d::Ref* pSender); 25 | 26 | void onTouchesEnded(const std::vector& touches, cocos2d::Event* event); 27 | void onTouchesBegan(const std::vector& touches, cocos2d::Event* event); 28 | 29 | // implement the "static create()" method manually 30 | CREATE_FUNC(GameMain); 31 | 32 | private: 33 | void addBalls(); 34 | void shootBalls(); 35 | Sprite* boardBg; 36 | //Vector shootballs = Vector(NUMBER); 37 | Ball* initballs[NUMBER]; 38 | Ball* ballArray[LENGTH][LENGTH]; 39 | Ball* choosedBall = nullptr; 40 | Vec2 firstBallPos = Vec2(0, 0); 41 | Vector emptyPoints = Vector(); 42 | void findEmpty(); 43 | //float posToDistance(int x); 44 | 45 | 46 | Vector openList = Vector(); 47 | Vector closeList = Vector(); 48 | 49 | Vector neighborList = Vector(); 50 | 51 | bool canReach(int x, int y); 52 | ANode* findPath(ANode* startNode, ANode* endNode); 53 | ANode* findMinFNodeInOpneList(); 54 | void findNeighborNodes(ANode* currentNode); 55 | void notFoundPoint(ANode* tempStart, ANode* end, ANode* node); 56 | 57 | Vector removedList = Vector(); 58 | void scan(); 59 | void scanAndShoot(); 60 | void scanHorizontal(); 61 | void scanVertical(); 62 | void scanLeftOblique(); 63 | void scanRightOblique(); 64 | int getColor(int x, int y); 65 | bool removeBall(); 66 | 67 | Animation* getRemoveAnimation(); 68 | void animationEnd(); 69 | LabelTTF* maxScoreLable; 70 | LabelTTF* scoreLable; 71 | int maxSocre = 0; 72 | int score = 0; 73 | 74 | 75 | }; 76 | 77 | #endif // __HELLOWORLD_SCENE_H__ 78 | -------------------------------------------------------------------------------- /Classes/HelloWorldScene.cpp: -------------------------------------------------------------------------------- 1 | #include "HelloWorldScene.h" 2 | 3 | USING_NS_CC; 4 | 5 | Scene* HelloWorld::createScene() 6 | { 7 | // 'scene' is an autorelease object 8 | auto scene = Scene::create(); 9 | 10 | // 'layer' is an autorelease object 11 | auto layer = HelloWorld::create(); 12 | 13 | // add layer as a child to scene 14 | scene->addChild(layer); 15 | 16 | // return the scene 17 | return scene; 18 | } 19 | 20 | // on "init" you need to initialize your instance 21 | bool HelloWorld::init() 22 | { 23 | ////////////////////////////// 24 | // 1. super init first 25 | if ( !Layer::init() ) 26 | { 27 | return false; 28 | } 29 | 30 | Size visibleSize = Director::getInstance()->getVisibleSize(); 31 | Vec2 origin = Director::getInstance()->getVisibleOrigin(); 32 | 33 | ///////////////////////////// 34 | // 2. add a menu item with "X" image, which is clicked to quit the program 35 | // you may modify it. 36 | 37 | // add a "close" icon to exit the progress. it's an autorelease object 38 | auto closeItem = MenuItemImage::create( 39 | "CloseNormal.png", 40 | "CloseSelected.png", 41 | CC_CALLBACK_1(HelloWorld::menuCloseCallback, this)); 42 | 43 | closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , 44 | origin.y + closeItem->getContentSize().height/2)); 45 | 46 | // create menu, it's an autorelease object 47 | auto menu = Menu::create(closeItem, NULL); 48 | menu->setPosition(Vec2::ZERO); 49 | this->addChild(menu, 1); 50 | 51 | ///////////////////////////// 52 | // 3. add your codes below... 53 | 54 | // add a label shows "Hello World" 55 | // create and initialize a label 56 | 57 | auto label = LabelTTF::create("Hello World", "Arial", 24); 58 | 59 | // position the label on the center of the screen 60 | label->setPosition(Vec2(origin.x + visibleSize.width/2, 61 | origin.y + visibleSize.height - label->getContentSize().height)); 62 | 63 | // add the label as a child to this layer 64 | this->addChild(label, 1); 65 | 66 | // add "HelloWorld" splash screen" 67 | auto sprite = Sprite::create("HelloWorld.png"); 68 | 69 | // position the sprite on the center of the screen 70 | sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); 71 | 72 | // add the sprite as a child to this layer 73 | this->addChild(sprite, 0); 74 | 75 | return true; 76 | } 77 | 78 | 79 | void HelloWorld::menuCloseCallback(Ref* pSender) 80 | { 81 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) 82 | MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert"); 83 | return; 84 | #endif 85 | 86 | Director::getInstance()->end(); 87 | 88 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) 89 | exit(0); 90 | #endif 91 | } 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Classes/HelloWorldScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __HELLOWORLD_SCENE_H__ 2 | #define __HELLOWORLD_SCENE_H__ 3 | 4 | #include "cocos2d.h" 5 | 6 | class HelloWorld : public cocos2d::Layer 7 | { 8 | public: 9 | // there's no 'id' in cpp, so we recommend returning the class instance pointer 10 | static cocos2d::Scene* createScene(); 11 | 12 | // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone 13 | virtual bool init(); 14 | 15 | // a selector callback 16 | void menuCloseCallback(cocos2d::Ref* pSender); 17 | 18 | // implement the "static create()" method manually 19 | CREATE_FUNC(HelloWorld); 20 | }; 21 | 22 | #endif // __HELLOWORLD_SCENE_H__ 23 | -------------------------------------------------------------------------------- /Classes/MainScene.cpp: -------------------------------------------------------------------------------- 1 | #include "MainScene.h" 2 | #include "GameMainScene.h" 3 | 4 | USING_NS_CC; 5 | 6 | Scene* Main::createScene() 7 | { 8 | // 'scene' is an autorelease object 9 | auto scene = Scene::create(); 10 | 11 | // 'layer' is an autorelease object 12 | auto layer = Main::create(); 13 | 14 | // add layer as a child to scene 15 | scene->addChild(layer); 16 | 17 | // return the scene 18 | return scene; 19 | } 20 | 21 | // on "init" you need to initialize your instance 22 | bool Main::init() 23 | { 24 | ////////////////////////////// 25 | // 1. super init first 26 | if ( !Layer::init() ) 27 | { 28 | return false; 29 | } 30 | 31 | Size visibleSize = Director::getInstance()->getVisibleSize(); 32 | Vec2 origin = Director::getInstance()->getVisibleOrigin(); 33 | 34 | ///////////////////////////// 35 | // 2. add a menu item with "X" image, which is clicked to quit the program 36 | // you may modify it. 37 | 38 | // add a "close" icon to exit the progress. it's an autorelease object 39 | auto closeItem = MenuItemImage::create( 40 | "CloseNormal.png", 41 | "CloseSelected.png", 42 | CC_CALLBACK_1(Main::menuCloseCallback, this)); 43 | 44 | closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , 45 | origin.y + closeItem->getContentSize().height/2)); 46 | 47 | // create menu, it's an autorelease object 48 | auto closeMenu = Menu::create(closeItem, NULL); 49 | closeMenu->setPosition(Vec2::ZERO); 50 | this->addChild(closeMenu, 1); 51 | 52 | ///////////////////////////// 53 | // 3. add your codes below... 54 | 55 | // add a label shows "Hello World" 56 | // create and initialize a label 57 | 58 | auto label = LabelTTF::create("海底连珠", "Arial", 70); 59 | //auto label = Label::createWithSystemFont("海底连珠", "海底连珠2", 24); 60 | 61 | // position the label on the center of the screen 62 | label->setPosition(Vec2(origin.x + visibleSize.width/2, 63 | origin.y + visibleSize.height - label->getContentSize().height)); 64 | 65 | // add the label as a child to this layer 66 | this->addChild(label, 1); 67 | 68 | // add background 69 | auto bg = Sprite::create("background.png"); 70 | 71 | bg->setPosition(visibleSize.width / 2, visibleSize.height / 2); 72 | bg->setScale(visibleSize.width / bg->getContentSize().width, visibleSize.height / bg->getContentSize().height); 73 | this->addChild(bg, 0); 74 | 75 | CCLOG("visibleSize.width = %f",visibleSize.width); 76 | CCLOG("visibleSize.height = %f",visibleSize.height); 77 | CCLOG("origin.x = %f",origin.x); 78 | CCLOG("origin.y = %f",origin.y); 79 | 80 | MenuItemFont::setFontSize(60); 81 | //MenuItemFont::setFontName(const std::string &name) 82 | auto menu1 = MenuItemFont::create("新游戏", CC_CALLBACK_1(Main::menuNewGameCallback, this)); 83 | auto menu2 = MenuItemFont::create("继续", CC_CALLBACK_1(Main::menuContinueCallback, this)); 84 | auto menu3 = MenuItemFont::create("如何玩", CC_CALLBACK_1(Main::menuHowToPlayCallback, this)); 85 | auto menu4 = MenuItemFont::create("排行榜", CC_CALLBACK_1(Main::menuRankCallback, this)); 86 | auto menu5 = MenuItemFont::create("更多游戏", CC_CALLBACK_1(Main::menuMoreGameCallback, this)); 87 | auto menu6 = MenuItemFont::create("去掉广告", CC_CALLBACK_1(Main::menuRemoveAdCallback, this)); 88 | 89 | auto s = Director::getInstance()->getWinSize(); 90 | auto mainMenu = Menu::create(menu1, menu2, menu3, menu4, menu5, menu6, nullptr); 91 | mainMenu->alignItemsVertically(); 92 | mainMenu->setPosition(Vec2(s.width/2, s.height/2)); 93 | addChild(mainMenu); 94 | //mainMenu->setScale(1); 95 | //mainMenu->runAction(ScaleTo::create(1,1)); 96 | 97 | return true; 98 | } 99 | 100 | void Main::menuNewGameCallback(Ref* pSender){ 101 | 102 | //Director::getInstance()->replaceScene(GameMain::createScene()); 103 | //auto transition = TransitionZoomFlipY::create(1.0f,GameMain::createScene()); 104 | auto transition = TransitionFade::create(0.2f,GameMain::createScene()); 105 | //auto transition = TransitionProgressInOut::create(0.5f,GameMain::createScene()); 106 | Director::getInstance()->pushScene(transition); 107 | 108 | } 109 | void Main::menuContinueCallback(Ref *pSender){ 110 | 111 | } 112 | void Main::menuHowToPlayCallback(Ref *pSender){ 113 | 114 | } 115 | void Main::menuRankCallback(Ref *pSender){ 116 | 117 | } 118 | void Main::menuMoreGameCallback(Ref *pSender){ 119 | 120 | } 121 | void Main::menuRemoveAdCallback(Ref *pSender){ 122 | 123 | } 124 | 125 | 126 | void Main::menuCloseCallback(Ref* pSender) 127 | { 128 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) 129 | MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert"); 130 | return; 131 | #endif 132 | 133 | Director::getInstance()->end(); 134 | 135 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) 136 | exit(0); 137 | #endif 138 | } 139 | -------------------------------------------------------------------------------- /Classes/MainScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_SCENE_H__ 2 | #define __MAIN_SCENE_H__ 3 | 4 | #include "cocos2d.h" 5 | 6 | class Main : public cocos2d::Layer 7 | { 8 | public: 9 | // there's no 'id' in cpp, so we recommend returning the class instance pointer 10 | static cocos2d::Scene* createScene(); 11 | 12 | // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of HelloWorldreturning 'id' in cocos2d-iphone 13 | virtual bool init(); 14 | 15 | // a selector callback 16 | void menuCloseCallback(cocos2d::Ref* pSender); 17 | void menuNewGameCallback(cocos2d::Ref* pSender); 18 | void menuContinueCallback(cocos2d::Ref* pSender); 19 | void menuHowToPlayCallback(cocos2d::Ref* pSender); 20 | void menuRankCallback(cocos2d::Ref* pSender); 21 | void menuMoreGameCallback(cocos2d::Ref* pSender); 22 | void menuRemoveAdCallback(cocos2d::Ref* pSender); 23 | 24 | // implement the "static create()" method manually 25 | CREATE_FUNC(Main); 26 | }; 27 | 28 | #endif // __HELLOWORLD_SCENE_H__ 29 | -------------------------------------------------------------------------------- /Classes/ShortestPathStep.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ShortestPathStep.cpp 3 | // LianZhu 4 | // 5 | // Created by Ruils on 14-10-7. 6 | // 7 | // 8 | 9 | #include "ShortestPathStep.h" 10 | ShortestPathStep::ShortestPathStep() : 11 | _position(Point::ZERO), 12 | _gScore(0), 13 | _hScore(0), 14 | _parent(nullptr) 15 | { 16 | } 17 | 18 | ShortestPathStep::~ShortestPathStep() 19 | { 20 | } 21 | 22 | ShortestPathStep* ShortestPathStep::createWithPosition(const Point &pos) 23 | { 24 | ShortestPathStep *pRet = new ShortestPathStep(); 25 | if (pRet && pRet->initWithPosition(pos)) 26 | { 27 | pRet->autorelease(); 28 | return pRet; 29 | } 30 | else 31 | { 32 | CC_SAFE_DELETE(pRet); 33 | return nullptr; 34 | } 35 | } 36 | 37 | bool ShortestPathStep::initWithPosition(const Point &pos) 38 | { 39 | bool bRet = false; 40 | do 41 | { 42 | this->setPosition(pos); 43 | 44 | bRet = true; 45 | } while (0); 46 | 47 | return bRet; 48 | } 49 | 50 | int ShortestPathStep::getFScore() const 51 | { 52 | return this->getGScore() + this->getHScore(); 53 | } 54 | 55 | bool ShortestPathStep::isEqual(const ShortestPathStep *other) const 56 | { 57 | return this->getPosition() == other->getPosition(); 58 | } 59 | 60 | std::string ShortestPathStep::getDescription() const 61 | { 62 | return StringUtils::format("pos=[%.0f;%.0f] g=%d h=%d f=%d", 63 | this->getPosition().x, this->getPosition().y, 64 | this->getGScore(), this->getHScore(), this->getFScore()); 65 | } -------------------------------------------------------------------------------- /Classes/ShortestPathStep.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShortestPathStep.h 3 | // LianZhu 4 | // 5 | // Created by Ruils on 14-10-7. 6 | // 7 | // 8 | 9 | #ifndef LianZhu_ShortestPathStep_h 10 | #define LianZhu_ShortestPathStep_h 11 | #include "cocos2d.h" 12 | USING_NS_CC; 13 | 14 | class ShortestPathStep : public cocos2d::Ref 15 | { 16 | public: 17 | ShortestPathStep(); 18 | ~ShortestPathStep(); 19 | static ShortestPathStep *createWithPosition(const cocos2d::Point &pos); 20 | bool initWithPosition(const cocos2d::Point &pos); 21 | int getFScore() const; 22 | bool isEqual(const ShortestPathStep *other) const; 23 | std::string getDescription() const; 24 | CC_SYNTHESIZE(cocos2d::Point, _position, Position); 25 | CC_SYNTHESIZE(int, _gScore, GScore); 26 | CC_SYNTHESIZE(int, _hScore, HScore); 27 | CC_SYNTHESIZE(ShortestPathStep*, _parent, Parent); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LianZhu 2 | ======= 3 | 4 | 海底连珠,基于Cocos2d-x-3.3游戏引擎,C++版本的一个五子连珠消除类游戏,可以学习基本的Cocos2d-x游戏开发,用到A*(A star)寻路算法,消除算法。 5 | 6 | 声明: 7 | 图片资源是从ios版本海底连珠游戏中拷贝出,版权归原作者所有。本项目只供学习参考用,不得用于商业用途。 8 | -------------------------------------------------------------------------------- /Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/.DS_Store -------------------------------------------------------------------------------- /Resources/CloseNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/CloseNormal.png -------------------------------------------------------------------------------- /Resources/CloseSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/CloseSelected.png -------------------------------------------------------------------------------- /Resources/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/HelloWorld.png -------------------------------------------------------------------------------- /Resources/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/background.png -------------------------------------------------------------------------------- /Resources/board_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/board_bg.png -------------------------------------------------------------------------------- /Resources/board_iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/board_iPad.png -------------------------------------------------------------------------------- /Resources/board_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/board_test.png -------------------------------------------------------------------------------- /Resources/chess0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess0.png -------------------------------------------------------------------------------- /Resources/chess1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess1.png -------------------------------------------------------------------------------- /Resources/chess2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess2.png -------------------------------------------------------------------------------- /Resources/chess3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess3.png -------------------------------------------------------------------------------- /Resources/chess4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess4.png -------------------------------------------------------------------------------- /Resources/chess5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess5.png -------------------------------------------------------------------------------- /Resources/chess6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/chess6.png -------------------------------------------------------------------------------- /Resources/e01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e01.png -------------------------------------------------------------------------------- /Resources/e02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e02.png -------------------------------------------------------------------------------- /Resources/e03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e03.png -------------------------------------------------------------------------------- /Resources/e04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e04.png -------------------------------------------------------------------------------- /Resources/e05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e05.png -------------------------------------------------------------------------------- /Resources/e06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e06.png -------------------------------------------------------------------------------- /Resources/e07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e07.png -------------------------------------------------------------------------------- /Resources/e08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e08.png -------------------------------------------------------------------------------- /Resources/e09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e09.png -------------------------------------------------------------------------------- /Resources/e10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e10.png -------------------------------------------------------------------------------- /Resources/e11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e11.png -------------------------------------------------------------------------------- /Resources/e12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e12.png -------------------------------------------------------------------------------- /Resources/e13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e13.png -------------------------------------------------------------------------------- /Resources/e14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e14.png -------------------------------------------------------------------------------- /Resources/e15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/e15.png -------------------------------------------------------------------------------- /Resources/fonts/Marker Felt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/fonts/Marker Felt.ttf -------------------------------------------------------------------------------- /Resources/game_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seashell752/LianZhu/4a5f5da15e5f2cea9447e069c04ea43e635c4343/Resources/game_bar.png --------------------------------------------------------------------------------