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


C++ Battle::Run方法代码示例

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


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

示例1: ProcessInput


//.........这里部分代码省略.........
					cout<<"-Qulz is the currency."<<endl;
					cout<<"-To heal, buy some potions or rest at an inn."<<endl;
					cout<<"-You gain a skill point at lvl 5,10,15,etc."<<endl;
					cout<<"-You can't escape from battle, so be careful."<<endl;
					cout<<"-To win, defeat a lvl 30 dungeon (Their level increases by 2 every time they're reset)."<<endl;
					system("pause");
					system("cls");
					cout<<"Welcome to TextRPG"<<endl;
				break;
			}//end switch Action
		}//end case
		break;
		case WORLDMAP:
		{
			switch(action)
			{
				case INVENTORYCHAR:
					system("cls");
					Process=PAUSEMENU;
					Map->GetCharacter()->PrintInventory();
				break;
				case EXPLORECHAR://Explore
					Map->Explore();
				break;
				case TRAINCHAR://Train
					Printer::pout<<"#014Battle!"<<endl;
					system("pause");
					system("cls");
					//random level
					level=Map->GetCurrentTile()->GetLevel()+rand()%3-1;
					if(level<=0)
						level=1;
					b=Battle(Map->GetCharacter(),Monster(Monster::GetRandomMonster(level),level),true);
					b.Run();
					system("pause");
					system("cls");
					Map->Draw();
				break;
				case ENTERTILECHAR://Enter town
					Process=TILECONTAINER;
					//system("pause");
					system("cls");
					Map->GetCharacter()->PrintInfo();
					Map->GetCurrentTile()->GetContainer()->DrawInfo();
				break;
				case TRAVELNORTHCHAR://Travel North
					x=Map->GetCharacter()->GetX();
					y=Map->GetCharacter()->GetY();
					Map->MoveCharacter(0,-1);
					Map->UpdateTile(x,y);
					Map->UpdateTile(Map->GetCharacter()->GetX(),Map->GetCharacter()->GetY());
					Map->UpdateTileInfo();
				break;
				case TRAVELSOUTHCHAR://Travel South
					x=Map->GetCharacter()->GetX();
					y=Map->GetCharacter()->GetY();
					Map->MoveCharacter(0,1);
					Map->UpdateTile(x,y);
					Map->UpdateTile(Map->GetCharacter()->GetX(),Map->GetCharacter()->GetY());
					Map->UpdateTileInfo();
				break;
				case TRAVELEASTCHAR://Travel East
					x=Map->GetCharacter()->GetX();
					y=Map->GetCharacter()->GetY();
					Map->MoveCharacter(1,0);
					Map->UpdateTile(x,y);
开发者ID:NicholasDenaro,项目名称:Text-Based-RPG,代码行数:67,代码来源:GameFlow.cpp


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