Browse Source

Arrumando bugs

capellaresumo 7 years ago
parent
commit
4ad1c00626

+ 2 - 1
Classes/GameScene.cpp

@@ -198,7 +198,8 @@ void GameScene::ball_collision (Node *ball) {
     text->setPosition(visibleSize.width/2, visibleSize.height/2);
     this->addChild(text);
     
-    this->level = -1;
+    UserDefault *userdata = UserDefault::getInstance();
+    level = userdata->getIntegerForKey("level", 0);
     auto menu_item_start = MenuItemFont::create("Restart", CC_CALLBACK_1(GameScene::NextLevel, this));
     menu_item_start->setPosition(text->getPosition());
     menu_item_start->setPositionY(menu_item_start->getPositionY()-50);

+ 2 - 1
Classes/HelloWorldScene.cpp

@@ -118,6 +118,7 @@ bool HelloWorld::init() {
         userdata->setIntegerForKey("level", level);
         diff = 3600 * 12 + last - sec;
     }
+    this->levels = level;
     
     char level_text[256];
     if (level != 0) {
@@ -132,7 +133,7 @@ bool HelloWorld::init() {
 }
 
 void HelloWorld::Play(cocos2d::Ref *pSender) {
-    auto scene = GameScene::createScene(0);
+    auto scene = GameScene::createScene(this->levels);
     Director::getInstance()->replaceScene(scene);
     //Director::getInstance()->end();
 }

+ 2 - 0
Classes/HelloWorldScene.h

@@ -13,6 +13,8 @@ public:
     
     // implement the "static create()" method manually
     CREATE_FUNC(HelloWorld);
+private:
+    int levels;
 };
 
 #endif // __HELLOWORLD_SCENE_H__

+ 1 - 1
Classes/params.h

@@ -43,6 +43,6 @@
 #define SAVE_TAG 8
 
 // Probabilitys
-#define DROP_LEVEL_SAVE 0.05
+#define DROP_LEVEL_SAVE 1 // deixar em 0.1
 
 #endif /* params_h */

BIN
proj.ios_mac/RedCore2.xcodeproj/project.xcworkspace/xcuserdata/capella.xcuserdatad/UserInterfaceState.xcuserstate