本文整理汇总了C++中Sector::is_free_of_statics方法的典型用法代码示例。如果您正苦于以下问题:C++ Sector::is_free_of_statics方法的具体用法?C++ Sector::is_free_of_statics怎么用?C++ Sector::is_free_of_statics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector::is_free_of_statics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TitleScreen::make_tux_jump()
{
static bool jumpWasReleased = true;
Sector* sector = titlesession->get_current_sector();
Player* tux = sector->player;
controller->update();
controller->press(Controller::RIGHT);
// Check if we should press the jump button
Rectf lookahead = tux->get_bbox();
lookahead.p2.x += 96;
bool pathBlocked = !sector->is_free_of_statics(lookahead);
if ((pathBlocked && jumpWasReleased) || !tux->on_ground()) {
controller->press(Controller::JUMP);
jumpWasReleased = false;
} else {
jumpWasReleased = true;
}
// Wrap around at the end of the level back to the beginning
if(sector->get_width() - 320 < tux->get_pos().x) {
sector->activate("main");
sector->camera->reset(tux->get_pos());
}
}