Browse Source

1496607985

capellaresumo 7 years ago
parent
commit
b432a255ac

+ 2 - 2
Classes/BlocksLayer.cpp

@@ -29,11 +29,11 @@ void BlocksLayer::setLevel(int level) {
                 i = 0;
             }
             circles_n = i + 1;
-            p_indus = j * 0.05;
+            p_indus = j * 0.05/delta*8.0;
             count++;
         }
     }
-    
+    CCLOG(">> %f", p_indus);
     this->setPosition(center);
     
     // aumentar aqui

+ 2 - 2
Classes/GameScene.cpp

@@ -90,7 +90,7 @@ bool GameScene::init() {
     // Inicialmente tem 1 bola
     ball_count = 1;
     
-    auto raquete = DrawNode::create();
+    raquete = DrawNode::create();
     float py = RAQUETE_HEIGHT/2.0;
     float pxl = - RAQUETE_WIDTH/2;
     float pxr =  RAQUETE_WIDTH/2;
@@ -204,7 +204,7 @@ bool GameScene::onContactBegin(PhysicsContact& contact) {
                 // cria as bolas e as adiciona no cenário
                 for (int i = ball_count; i < 3; i++, ball_count++) {
                     auto ball = Ball::create();
-                    ball->setPosition(nodeB->getPositionX(), RAQUETE_ALTURA+BALL_SIZE);
+                    ball->setPosition(raquete->getPositionX(), RAQUETE_ALTURA+BALL_SIZE+i);
                     ball->throwBall();
                     this->addChild(ball, 21);
                 }

+ 1 - 0
Classes/GameScene.h

@@ -27,6 +27,7 @@ class GameScene : public cocos2d::Layer {
         void tripleBalls();
         bool over; // salva se o jogo acabou!
         int ball_count;
+        cocos2d::DrawNode * raquete;
 };
 
 

+ 4 - 4
Classes/HelloWorldScene.cpp

@@ -83,12 +83,12 @@ bool HelloWorld::init() {
     level = userdata->getIntegerForKey("level");
     last = userdata->getDoubleForKey("time");
     unsigned long int sec = time(NULL);
-    diff = 3600 * 12 + last - sec;
-    
+    diff = 3600 * LOSE_IS + last - sec;
+        
     while (diff < 0 && level > 0) {
-        last += 3600.0*12.0;
+        last += 3600.0* ((double) LOSE_IS);
         level--;
-        diff = 3600 * 12 + last - sec;
+        diff = 3600 * LOSE_IS + last - sec;
     }
     
     userdata->setDoubleForKey("time", last);

+ 4 - 1
Classes/params.h

@@ -43,7 +43,10 @@
 #define SAVE_TAG 8
 
 // Probabilities
-#define DROP_LEVEL_SAVE 0.05 // deixar em 0.1
+#define DROP_LEVEL_SAVE 0.1 // deixar em 0.1
 #define DROP_TRIPLE_BALL 0.1
 
+// Hours to lose level
+#define LOSE_IS 12
+
 #endif /* params_h */

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


+ 16 - 0
proj.ios_mac/RedCore2.xcodeproj/xcuserdata/capella.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -35,5 +35,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../Classes/GameScene.cpp"
+            timestampString = "518300050.594662"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "97"
+            endingLineNumber = "97"
+            landmarkName = "GameScene::init()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>