if (battery2 == NULL&&battery1 != NULL&&str == "right"){ //增加炮台等级
//this->addBattery(sss);
battery2 = Sprite::create("paotai2.png");
battery2->setPosition(Vec2(visibleSize.width / 2 + 90, visibleSize.height / 2 - 340));
this->addChild(battery2, 9);
if (battery1 != NULL){
battery1->removeFromParent();
battery1 = NULL;
}
}
else if (battery2 != NULL&&battery1 == NULL&&str == "left"){ //减少炮台等级
//this->cutBattery(sss);
battery1 = Sprite::create("paotai1.png");
battery1->setPosition(Vec2(visibleSize.width / 2 + 90, visibleSize.height / 2 - 340));
addChild(battery1, 9);
if (battery2 != NULL){
battery2->removeFromParent();
battery2 = NULL;
}
}
两个炮台切换的笔记(局限性)
最新推荐文章于 2024-11-25 23:12:48 发布