本文整理汇总了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;
}