/// <summary> /// Создаёт новый инстанс NPCatchable с заданными координатами.<br/> /// По логике игры, для "рождения" новых NPCatchable следует использовать конструктор без координаты Y. /// </summary> public NPCatchable(NPGame game, NPCatchableFactory factory) { this.UID = game.Random.Next(); this.Dead = false; this.Game = game; this.Factory = factory; }
public NPCatchable Create(NPGame game) { int spawnX = game.Random.Next(0, game.Width - this.Width); NPCatchable spawn = new NPCatchable(game, this) { Reward = this.Reward, Penalty = this.Penalty, Width = this.Width, Height = this.Height, XPosition = spawnX, YPosition = -this.Height, FallRate = (int)game.FallRate, FallRateFactor = this.FallRateFactor }; return(spawn); }
/// <summary> /// Создает новый инстанс NPCatcher. /// </summary> /// <param name="maxPositions">Максимальное кол-во позиций. В оригинальной игре "Ну, Погоди!" этот параметр был бы равен 4.</param> public NPCatcher(NPGame game, int width, int height) { this.Game = game; this.Width = width; this.Height = height; }
public double GetCommonness(NPGame game) { return(Commonness); }