public Snake(Game game, Map map, int countBlock = 3) : base(game) { _body = new List<SnakeBlock>(); _length = countBlock; _map = map; Location = new Vector2(0, 0); }
public Mongoose(Game game, Map map) : base(game) { _texture = game.Content.Load<Texture2D>("Mangoose"); _speed = Helper.SpeedMangoose; _map = map; tiks = (long) Math.Truncate(Game.TargetElapsedTime.Ticks/_speed); CurrentPathChanged += OnCurrentPathChanged; }
protected override void Initialize() { var map = new Map(this, _isHard) {Location = new Vector2(10, 10)}; map.Snake.CountBlockChanged += SnakeOnCountBlockChanged; Components.Add(map); var grid = new Grid(this, new Rectangle(graphics.PreferredBackBufferWidth - 150, 10, 140, graphics.PreferredBackBufferHeight - 30), new Vector2(140, graphics.PreferredBackBufferHeight - 30)); grid.Color = Color.BlueViolet; Components.Add(grid); var statisticAppleBlock = new AppleBlock(this) { Location = new Vector2(graphics.PreferredBackBufferWidth - 140, 60), Size = new Vector2(30, 30) }; Components.Add(statisticAppleBlock); _locationCountEatenApples = new Vector2(graphics.PreferredBackBufferWidth - 100, 50); base.Initialize(); }