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; }
public InGamePosition Do(GameState state, GameObjectParameters enemyParameters) { InvocationsCount++; return(OnDo?.Invoke(state, enemyParameters)); }
public EnemyModel(IEnemyBehavior enemyBehavior, GameObjectParameters gameObjectParameters) { ObjectParameters = gameObjectParameters; EnemyBehavior = enemyBehavior; }
public InGamePosition Do(GameState state, GameObjectParameters enemyParameters) { return(new InGamePosition()); }
public InGamePosition Do(GameState state, GameObjectParameters enemyParameters) { return(new InGamePosition { X = -state.Speed * enemySpeed }); }