本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例5: become_faller
void become_faller(Lixxie& l)
{
l.become_default(LixEn::FALLER);
l.set_special_y(4);
}
示例6: become_builder
void become_builder(Lixxie& l)
{
l.become_default(LixEn::BUILDER);
l.set_special_x(12);
l.set_frame(6);
}
示例7: become_exiter
void become_exiter(Lixxie& l)
{
l.become_default(LixEn::EXITER);
l.set_updates_since_bomb(0);
}