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


C++ Character::Draw方法代码示例

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


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

示例1: DisplayDirection

void DisplayDirection(int zero, int one, int two)
{
	switch (current_frame)
       {
       case 0:
		   Gerad.Draw(zero);
	       break;
       case 1:
		   Gerad.Draw(one);
	       break;
       case 2:
		   Gerad.Draw(zero);
	       break;
       case 3:
		   Gerad.Draw(two);
	       break;
       default:
		   Gerad.Draw(zero);
	       break;
       }
	return;
}
开发者ID:drew55555,项目名称:games,代码行数:22,代码来源:Walking+Animation.cpp

示例2: main

int main(void)
{
	// 3가지 사용....
	// 동적할당...
	// 함수인자...
	// 참조

	Character Human;

	Human.SetData(new Data(Data::KNIGHT, Data::MALE));

	Human.Draw();


	_getch();
	return 0;
}
开发者ID:KimYoungJoo,项目名称:SGA47,代码行数:17,代码来源:main_pointer.cpp

示例3:

void Stage_1::update()
{
	GetFrame();
	Input_device->GetKeyState();
	if( Input_device->IsKeyDown( DIK_ESCAPE ) )
	{
		obj->SetNextMode( obj->MODE_END );
		obj->RemoveModeObject();
	}else {
		switch( sstate ) {
		case MOVE_1:
			for( _TaskIterator i( ListObj.Enemy ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Draw();
			}
			for( _TaskIterator i( ListObj.Player ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Draw();
			}
			DrawBase->Draw( 0.0f, 0.0f );
			font_1->Draw( _T( "避けろ!" ), 130, 140 );
			font_2->Draw( _T( "Zキーで始まる" ), 180, 220 );
			if( Input_device->IsKeyPressed( DIK_Z ) )
			{
				sstate = MOVE_2;
			}
			break;
		case MOVE_2:
			for( _TaskIterator i( ListObj.Enemy ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Move();
			}
			for( _TaskIterator i( ListObj.Bullet ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Move();
				if( !chara->GetAlive() ) {
					chara->Uninit();
					i.Remove();
				}
			}
			for( _TaskIterator i( ListObj.Player ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Move();
				if( !chara->GetAlive() ) {
					chara->Uninit();
					i.Remove();
					sstate = MOVE_3;
				}
			}
			for( _TaskIterator i( ListObj.Enemy ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Draw();
			}
			for( _TaskIterator i( ListObj.Player ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Draw();
			}
			for( _TaskIterator i( ListObj.Bullet ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Draw();
			}

			DrawBase->Draw( 0.0f, 0.0f );
			TCHAR buf[10];
			swprintf_s( buf, _T( "%d" ), count );
			RECT rect;
			rect = { 500, 205, 500, 205 };
			font_3->Draw( buf, -1, &rect, DT_NOCLIP | DT_SINGLELINE, 0xFF000000 );
			rect = { 465, 170, 465, 170 };
			font_3->Draw( _T( "残り時間" ), -1, &rect, DT_NOCLIP | DT_SINGLELINE, 0xFF000000 );

			frame = ( frame + 1 ) % 60; 
			if( frame == 0 ) { count--; }
			if( count == 0 ) 
			{
				sstate = MOVE_4;
			}
			break;
		case MOVE_3:
			for( _TaskIterator i( ListObj.Enemy ); i.HasNext(); )
			{
				Character* chara = static_cast< Character* >( i.Next() );
				chara->Draw();
			}
			DrawBase->Draw( 0.0f, 0.0f );
			font_1->Draw( _T( "GAME OVER" ), 105, 140 );
			font_2->Draw( _T( "Zキーで戻る" ), 180, 220 );
			if( Input_device->IsKeyPressed( DIK_Z ) )
			{
				obj->SetNextMode( obj->MODE_TITLE );
				obj->RemoveModeObject();
			}
//.........这里部分代码省略.........
开发者ID:RYUSAchan,项目名称:Shooting,代码行数:101,代码来源:Stage.cpp


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