當前位置: 首頁>>代碼示例>>C#>>正文


C# GameState.setFlags方法代碼示例

本文整理匯總了C#中GameState.setFlags方法的典型用法代碼示例。如果您正苦於以下問題:C# GameState.setFlags方法的具體用法?C# GameState.setFlags怎麽用?C# GameState.setFlags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GameState的用法示例。


在下文中一共展示了GameState.setFlags方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: createGameState

		private GameState createGameState(){
			GameState state = new GameState (player1.getXPos(),player1.getYPos(),player2.getXPos(),
				player2.getYPos(),player1.getHealth(),player2.getHealth());

			bool p1attacking = false, p1high = false, p1blocking = false, p1crouching = false;

			if (player1.attackHandle ()) {
				p1attacking = true;
				p1high = player1.isHighAttack ();
			} else if (player1.isLowBlocking ()) {
				p1blocking = true;
			} else if (player1.isHighBlocking ()) {
				p1blocking = true;
				p1high = true;
			} else if (false) { //TODO: fill in when crouching implemented
				p1crouching = true;
			}

			bool p2attacking = false, p2high = false, p2blocking = false, p2crouching = false;
			if (player2.attackHandle ()) {
				p2attacking = true;
				p2high = player2.isHighAttack ();
			} else if (player2.isLowBlocking ()) {
				p2blocking = true;
			} else if (player2.isHighBlocking ()) {
				p2blocking = true;
				p2high = true;
			} else if (false) { //TODO: fill in when crouching implemented
				p2crouching = true;
			}

			state.setFlags (p1attacking, p1blocking, p1crouching, p1high, 
				p2attacking, p2blocking, p2crouching, p2high);

			return state;
		}
開發者ID:rhyschris,項目名稱:CS194Project,代碼行數:36,代碼來源:GameDelegate.cs


注:本文中的GameState.setFlags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。