本文整理匯總了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;
}