当前位置: 首页>>代码示例>>C++>>正文


C++ Lixxie::become_default方法代码示例

本文整理汇总了C++中Lixxie::become_default方法的典型用法代码示例。如果您正苦于以下问题:C++ Lixxie::become_default方法的具体用法?C++ Lixxie::become_default怎么用?C++ Lixxie::become_default使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lixxie的用法示例。


在下文中一共展示了Lixxie::become_default方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: become_ascender

void become_ascender(Lixxie& l)
{
    l.become_default(LixEn::ASCENDER);

    // determine the height to step up. Seek a floor pixel with air above it.
    int swh = 0;
    while (swh < 26 && ! (l.is_solid(0, 2 - swh) && ! l.is_solid(0, 1 - swh)))
        ++swh;
    int frame = 5; // this is the last frame
    switch (swh) {
        case 0:  case 1:
        case 2:  case 3:  frame = 5; break;
        case 4:  case 5:  frame = 4; break;
        case 6:  case 7:  frame = 3; break;
        case 8:  case 9:  frame = 2; break;
        case 10: case 11: frame = 1; break;
        default:          frame = 0; break;
    }
    int swh_wanted = 10 - frame * 2;
    l.set_frame(frame);

    // Move up, [check for even cliff,] move down again
    l.move_up(swh);
    // This was in earlier versions to look good, but the community frowned
    // on it for inconsistency; and sometimes the skipped x-pixels have indeed
    // yielded problems.
    // if (! l.is_solid(2, 0) && ! l.is_solid(2, 1)) l.move_ahead();
    l.move_down(swh_wanted);
}
开发者ID:twelvedogs,项目名称:Lix,代码行数:29,代码来源:ascender.cpp

示例2: become_drowner

void become_drowner(Lixxie& l)
{
    int drowner_frame = 0;
    if (l.get_ac() == LixEn::TUMBLER
        && l.get_frame() > tumbler_frame_steep_drown) {
        drowner_frame = drowner_steep_frame;
    }
    l.become_default(LixEn::DROWNER);
    l.set_frame(drowner_frame);
}
开发者ID:AmandaBayless,项目名称:Lix,代码行数:10,代码来源:deaths.cpp

示例3: become_platformer

void become_platformer(Lixxie& l)
{
    const bool continue_on_same_height
        = (l.get_ac() == LixEn::SHRUGGER2
        && l.get_frame() < platformer_standing_up_frame);

    l.become_default(LixEn::PLATFORMER);
    l.set_special_x(12);
    l.set_frame(continue_on_same_height ? 16 : 0);
}
开发者ID:AmandaBayless,项目名称:Lix,代码行数:10,代码来源:platform.cpp

示例4: become_jumper

void become_jumper(Lixxie& l)
{
    l.become_default(LixEn::JUMPER);
    if (l.get_runner()) {
        l.set_special_x(  8); // X-speed
        l.set_special_y(-12); // Y-speed
    }
    else {
        l.set_special_x( 6); // X-speed
        l.set_special_y(-8); // Y-speed
    }

    for (int i = -4; i > -16; --i)
     if (l.is_solid(0, i)) {
        l.become(LixEn::STUNNER);
        return;
    }
}
开发者ID:AmandaBayless,项目名称:Lix,代码行数:18,代码来源:jumper.cpp

示例5: become_faller

void become_faller(Lixxie& l)
{
    l.become_default(LixEn::FALLER);
    l.set_special_y(4);
}
开发者ID:AmandaBayless,项目名称:Lix,代码行数:5,代码来源:faller.cpp

示例6: become_builder

void become_builder(Lixxie& l)
{
    l.become_default(LixEn::BUILDER);
    l.set_special_x(12);
    l.set_frame(6);
}
开发者ID:AmandaBayless,项目名称:Lix,代码行数:6,代码来源:builder.cpp

示例7: become_exiter

void become_exiter(Lixxie& l)
{
    l.become_default(LixEn::EXITER);
    l.set_updates_since_bomb(0);
}
开发者ID:twelvedogs,项目名称:Lix,代码行数:5,代码来源:exiter.cpp


注:本文中的Lixxie::become_default方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。