示例#1
0
 public PlayerModel(int initialHealth, InGamePosition position,
                    Dictionary <PlayerState, GameObjectSize> sizesByState, PlayerState initialState = PlayerState.OnGround)
 {
     this.initialHealth = initialHealth;
     this.sizesByState  = sizesByState;
     State            = initialState;
     ObjectParameters = new GameObjectParameters
     {
         Position = position,
         Size     = sizesByState[PlayerState.OnGround]
     };
     initialJumpSpeed =
         Math.Sqrt(ObjectParameters.Size.Height * GravityAcceleration * (1 + JumpPeakByPlayerHeight));
     MaxJumpHeight = ObjectParameters.Size.Height * JumpPeakByPlayerHeight;
 }
示例#2
0
 public InGamePosition Do(GameState state, GameObjectParameters enemyParameters)
 {
     InvocationsCount++;
     return(OnDo?.Invoke(state, enemyParameters));
 }
示例#3
0
 public EnemyModel(IEnemyBehavior enemyBehavior, GameObjectParameters gameObjectParameters)
 {
     ObjectParameters = gameObjectParameters;
     EnemyBehavior    = enemyBehavior;
 }
示例#4
0
 public InGamePosition Do(GameState state, GameObjectParameters enemyParameters)
 {
     return(new InGamePosition());
 }
 public InGamePosition Do(GameState state, GameObjectParameters enemyParameters)
 {
     return(new InGamePosition {
         X = -state.Speed * enemySpeed
     });
 }