ButtonSprite* GatyaTenDrawScene::createButton(ButtonSprite::ButtonType buttonType, ButtonSprite::PositionIndex positionIndex) { auto button = ButtonSprite::create(positionIndex, buttonType); button->setPositionIndex(positionIndex); addChild(button, Z_BUTTON, T_BUTTON); return button; }
CardSprite* GatyaTenDrawScene::createCard(CardSprite::PositionIndex positionIndex, int tag) { auto card = CardSprite::create(positionIndex); card->setPositionIndex(positionIndex); card->setScale(CARD_SCALE); addChild(card, Z_CARD, CARD_TAG+tag); return card; }
//ボール落下アニメーション void BallSprite::fallingAnimation(int maxRemovedNo) { if (_fallCount > 0) { setPositionIndex(PositionIndex(_positionIndex.x, _positionIndex.y - _fallCount)); auto delay = DelayTime::create(ONE_ACTION_TIME * maxRemovedNo); auto show = Show::create(); auto move = MoveTo::create(ONE_ACTION_TIME, getPositionForPositionIndex(getPositionIndex())); runAction(Sequence::create(delay, show, move, nullptr)); } }
//インデックスとタグと位置を変更する void BallSprite::setPositionIndexAndChangePosition(PositionIndex positionIndex) { setPositionIndex(positionIndex); //インデックスとタグを変更する resetPosition(); //位置を変更する }