mirror of https://github.com/axmolengine/axmol.git
Merge pull request #4922 from Dhilan007/develop_crash
fix crash in TouchesTest.cpp on vs
This commit is contained in:
commit
b934b4633c
|
@ -43,7 +43,6 @@ PongLayer::PongLayer()
|
||||||
_ball->setPosition( VisibleRect::center() );
|
_ball->setPosition( VisibleRect::center() );
|
||||||
_ball->setVelocity( _ballStartingVelocity );
|
_ball->setVelocity( _ballStartingVelocity );
|
||||||
addChild( _ball );
|
addChild( _ball );
|
||||||
_ball->retain();
|
|
||||||
|
|
||||||
auto paddleTexture = Director::getInstance()->getTextureCache()->addImage(s_Paddle);
|
auto paddleTexture = Director::getInstance()->getTextureCache()->addImage(s_Paddle);
|
||||||
|
|
||||||
|
@ -77,7 +76,6 @@ PongLayer::PongLayer()
|
||||||
|
|
||||||
PongLayer::~PongLayer()
|
PongLayer::~PongLayer()
|
||||||
{
|
{
|
||||||
_ball->release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PongLayer::resetAndScoreBallForPlayer(int player)
|
void PongLayer::resetAndScoreBallForPlayer(int player)
|
||||||
|
@ -102,7 +100,6 @@ void PongLayer::doStep(float delta)
|
||||||
resetAndScoreBallForPlayer( kLowPlayer );
|
resetAndScoreBallForPlayer( kLowPlayer );
|
||||||
else if (_ball->getPosition().y < VisibleRect::bottom().y-_ball->radius())
|
else if (_ball->getPosition().y < VisibleRect::bottom().y-_ball->radius())
|
||||||
resetAndScoreBallForPlayer( kHighPlayer );
|
resetAndScoreBallForPlayer( kHighPlayer );
|
||||||
_ball->draw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PongScene::runThisTest()
|
void PongScene::runThisTest()
|
||||||
|
|
Loading…
Reference in New Issue