本文整理汇总了C++中Dot::is_onGround方法的典型用法代码示例。如果您正苦于以下问题:C++ Dot::is_onGround方法的具体用法?C++ Dot::is_onGround怎么用?C++ Dot::is_onGround使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dot
的用法示例。
在下文中一共展示了Dot::is_onGround方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
SDL_Rect gun :: get_position(Dot myDot, Setup foo)
{
if(look_up)
{
box.x = myDot.box.x;
box.y = myDot.box.y;
weapons2T.loadFromFile( "first_test16.bmp" );
}
else if(look_down && !myDot.is_onGround()) ///very much so temp--- this should be its own move, once i get moves sorted :D
{
box.x = myDot.box.x;
box.y = myDot.box.y + (myDot.box.h - speed);
weapons2T.loadFromFile( "first_test15.bmp" );
}
else
{
if(!direction)
{
box.x = myDot.box.x + (trueWidth - speed);
weapons2T.loadFromFile( "first_test14.bmp" );
}
else
{
box.x = (myDot.box.x - 128) + (128 - trueWidth);
weapons2T.loadFromFile( "first_test13.bmp" );
}
box.y = myDot.box.y + trueHeight/2;
}
return box;
}
示例2: if
SDL_Rect sword :: get_position(Dot myDot, Setup foo)
{
if(look_up)
{
box.x = myDot.box.x;
box.y = (myDot.box.y - le) + properHeight;
weaponsT.loadFromFile( "first_test12.bmp" );
}
else if(look_down && !myDot.is_onGround()) ///very much so temp--- this should be its own move, once i get moves sorted :D
{
box.x = myDot.box.x;
box.y = myDot.box.y + myDot.box.h;
weaponsT.loadFromFile( "first_test11.bmp" );
}
else
{
if(!direction)
{
box.x = myDot.box.x + trueWidth;
weaponsT.loadFromFile( "first_test10.bmp" );
}
else
{
box.x = (myDot.box.x - 128) + (128 - trueWidth);
weaponsT.loadFromFile( "first_test9.bmp" );
}
box.y = myDot.box.y + trueHeight/2;
return box;
}
}
示例3: weaponControl
void gun:: weaponControl(Dot myDot)
{
// Uint8 *keystates = SDL_GetKeyState( NULL );
Mix_PlayChannel( -1, gunSound, 0 );
if(!direction)
{
right = true;
left = false;
}
else
{
left = true;
right = false;
}
if(up)
{
look_up = true;
right = false;
left = false;
}
else
{
look_up = false;
}
if(down && !myDot.is_onGround())
{
look_down = true;
}
else
{
look_down = false;
}
for( int p = 0; p < 20; p++ )
{
particles[ p ] = new Particle( box.x, box.y, 4);
}
}