|
@@ -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);
|
|
|
}
|