cocos2dx吧 关注:10,998贴子:33,683
  • 2回复贴,共1

新手求教啊。。

取消只看楼主收藏回复

各位大神,本人cocos新手,照着书上的大富翁游戏开始学着做,现在碰到问题了。。在游戏过程中直接关掉游戏就有如下提示
不知道问题出在哪里。。请各路大神赐教!


IP属地:北京1楼2016-05-25 14:40回复
    #ifndef __GAME_BASE_SCENE_H__
    #define __GAME_BASE_SCENE_H__
    #include "cocos2d.h"
    #include "cocos-ext.h"
    #include "ConstUtil.h"
    #include "RicherPlayer.h"
    #include "RouteNavigation.h"
    #include "Util.h"
    #include <vector>
    #include "popupLayer\PopupLayer.h"
    #include "PopupLayer\CocosToast.h"
    #include "LanguageString.h"
    #include "prop\Strength_up.h"
    #include "prop\Bee.h"
    #include "prop\Fog.h"
    #include "prop\Stretcher.h"
    #include "prop\Emergency.h"
    #include "prop\Pearl.h"
    #include "lottery\LotteryCard.h"
    #include "stock/LineChart.h"
    #include "skill\SkillCard.h"
    #include "json/document.h"
    #include "json/writer.h"
    #include "json/stringbuffer.h"
    #include "string.h"
    USING_NS_CC;
    USING_NS_CC_EXT;
    using namespace rapidjson;
    const int tableStartPosition_x = 650;
    const int tableStartPosition_y = 450;
    const int tableWidth = 50;
    const int tableHeight = 40;
    const int tiledWidth = 32;
    const int tiledHeight = 32;
    const int goButtonTag = 700;
    const int skillButtonTag = 701;
    const int skillStormTag = 702;
    const int skillStepTag = 703;
    const int skillTransferTag = 704;
    const int saveButtonTag = 705;
    const int audioButtonTag = 706;
    const int backButtonTag = 707;
    const int stepBaseTag = 800;
    const int step1_tag = stepBaseTag + 1;
    const int step2_tag = stepBaseTag + 2;
    const int step3_tag = stepBaseTag + 3;
    const int step4_tag = stepBaseTag + 4;
    const int step5_tag = stepBaseTag + 5;
    const int step6_tag = stepBaseTag + 6;
    const int skillSpriteCardWidth = 150;
    const int skillSpriteCardHeight = 100;
    const float stepSkillAnimaTime = 0.1;
    const int _Quit_Dialog_Size_Width = 400;
    const int _Quit_Dialog_Size_Height = 220;
    const int _Btn_Quit_Game_TAG = 10004;
    const int _Btn_Quit_OK_TAG = 10005;
    const int _Btn_Quit_Cancel_TAG = 10006;
    const int _Btn_Width = 222;
    const int _Btn_Height = 50;
    class GameBaseScene: public Layer
    {
    public:
    static Scene* createScene();
    static TMXTiledMap* _map;
    virtual bool init();
    CREATE_FUNC(GameBaseScene);
    static int tiledColsCount;
    static int tiledRowsCount;
    static bool** canPassGrid;
    static TMXLayer* landLayer;
    static TMXLayer* wayLayer;
    std::vector<Vec2> wayLayerPass_vector;
    CC_SYNTHESIZE(Menu*, _menu, Menu);
    CC_SYNTHESIZE(LabelTTF *, player1_money_label, Player1_money_label);
    CC_SYNTHESIZE(LabelTTF *, player2_money_label, Player2_money_label);
    CC_SYNTHESIZE(LabelTTF *, player1_strength_label, Player1_strength_label);
    CC_SYNTHESIZE(LabelTTF *, player2_strength_label, Player2_strength_label);
    MenuItemImage* goMenuItemButton;
    int randStepsNumber;
    void setWayPassToGrid();
    //void onExit();
    void addGoButton();
    void menuButtonCallback(Object* pSender);
    void onReceiveCustomEvent(EventCustom* event);
    EventListenerCustom* customListener;
    RicherPlayer* player1;
    RicherPlayer* player2;
    static Vector<RicherPlayer*> players_vector;
    static Vector<Sprite*> pathMarkVector;
    static void drawPathColor(std::vector<int> rowVector, std::vector<int> colVector);
    static int blank_land_tiledID;
    static int strength_30_tiledID;
    static int strength_50_tiledID;
    static int strength_80_tiledID;
    static int randomEvent_tiledID;
    static int lottery_tiledID;
    static int stock_tiledID;
    static int player1_building_1_tiledID;
    static int player1_building_2_tiledID;
    static int player1_building_3_tiledID;
    static int player2_building_1_tiledID;
    static int player2_building_2_tiledID;
    static int player2_building_3_tiledID;
    int map_level;
    char* saveJsonName;
    bool reloadGame(int map_level);
    private:
    Size visibleSize;
    void drawTable(int playerNumber);
    void addPlayer();
    void addRightBanner();
    void addNotificationObserver();
    void receivedNotificationMsg(Object* data);
    void addDigiteRoundSprite();
    int gameRoundCount;
    Vector<SpriteFrame*> digiteRoundVector;
    Vector<Sprite*> refreshRoundVector;
    void refreshRoundDisplay();
    void addPathMark();
    PopupLayer* popDialog;
    void initPopDialog();
    void initLandLayerFromMap();
    int buy_land_x;
    int buy_land_y;
    void showBuyLandDialog(int landTag);
    void buyLandCallback(Node *pNode);
    void doSomeForParticle();//把动画相关的脚印精灵加载进来
    FadeOut* landFadeOut;
    FadeIn* landFadeIn;
    Sprite* foot1Sprite;
    Sprite* foot2Sprite;
    Sprite* starFish1Sprite;
    Sprite* starFish2Sprite;
    Sprite* heart1Sprite;
    Sprite* heart2Sprite;
    @夜战飞飞


    IP属地:北京4楼2016-05-25 22:41
    回复
      顶🔝


      IP属地:北京来自iPhone客户端7楼2016-05-31 01:39
      收起回复