本文整理汇总了C++中Shell::setRight方法的典型用法代码示例。如果您正苦于以下问题:C++ Shell::setRight方法的具体用法?C++ Shell::setRight怎么用?C++ Shell::setRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell::setRight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check
//.........这里部分代码省略.........
{
this->setTop(this->top() + 8);
}
this->state_ = FIRE_STATE;
Level::sharedLevel()->removeDrawable(objt);
break;
case COIN:
game->addCoin();
Level::sharedLevel()->removeDrawable(objt);
break;
}
objb = this->checkBottom();
//All objects that can hit Mario from the bottom
if (objb) {
Shell *nshell;
switch (objb->objectType()) {
// if Mario lands on anything solid
// stop Mario from falling
case PIPE:
case OFFQUESTION:
case BREAKABLE:
case REGULAR:
case QUESTION:
if (this->getYVelocity() < 0) {
this->setYVelocity(0.0);
}
break;
// Mario lands on an enemy
// if Turtle, generate shell
case TURTLE:
nshell = new Shell();
nshell->setTop(objb->top()-8);
nshell->setRight(objb->right());
nshell->setLeft(objb->left());
nshell->setBottom(objb->bottom());
Level::sharedLevel()->addMovable(nshell);
//break;
// if Goomba, kill enemy and
// reset jumpCount to half for bounce
case GOOMBA:
game->jumpEnemy(1);
Level::sharedLevel()->removeDrawable(objb);
this->jumpCount_ = 25;
this->setYVelocity(2.0);
case SHELL:
case ENEMYFIREBALL:
break;
// if Mario lands on a reward, increase state accordingly or
// add points
case MUSHROOM:
game->addPowerup();
Level::sharedLevel()->removeDrawable(objb);
if (this->state_ == SMALL_STATE) {
this->state_ = BIG_STATE;
this->setTop(this->top() + 8);
}
break;
// Make Mario invincible for 1000 frames
case STAR:
game->addPowerup();
starCount_ = 1000;
break;
case FIREFLOWER:
game->addPowerup();
if (state_ == SMALL_STATE)
示例2: check
//.........这里部分代码省略.........
break;
case FIREFLOWER:
game->addPowerup();
if (state_ == SMALL_STATE)
{
this->setTop(this->top() + 8);
}
this->state_ = FIRE_STATE;
Level::sharedLevel()->removeDrawable(objt);
break;
case COIN:
game->addCoin();
Level::sharedLevel()->removeDrawable(objt);
break;
}
objb = this->checkBottom();
//All objects that can hit Mario from the bottom
if (objb) {
Shell *nshell;
switch (objb->objectType()) {
case PIPE:
case OFFQUESTION:
case BREAKABLE:
case REGULAR:
case QUESTION:
if (this->getYVelocity() < 0) {
this->setYVelocity(0.0);
}
break;
case TURTLE:
nshell = new Shell();
nshell->setTop(objb->top()-8);
nshell->setRight(objb->right());
nshell->setLeft(objb->left());
nshell->setBottom(objb->bottom());
Level::sharedLevel()->addMovable(nshell);
//break;
case GOOMBA:
game->jumpEnemy(1);
Level::sharedLevel()->removeDrawable(objb);
this->jumpCount_ = 25;
this->setYVelocity(2.0);
case SHELL:
case ENEMYFIREBALL:
break;
case MUSHROOM:
game->addPowerup();
Level::sharedLevel()->removeDrawable(objb);
if (this->state_ == SMALL_STATE) {
this->state_ = BIG_STATE;
this->setTop(this->top() + 8);
}
break;
case STAR:
game->addPowerup();
starCount_ = 1000;
break;
case FIREFLOWER:
game->addPowerup();
if (state_ == SMALL_STATE)
{
this->setTop(this->top() + 8);
}
this->state_ = FIRE_STATE;
Level::sharedLevel()->removeDrawable(objb);