Exemple #1
0
 public Snake(Game game, Map map, int countBlock = 3)
     : base(game)
 {
     _body = new List<SnakeBlock>();
     _length = countBlock;
     _map = map;
     Location = new Vector2(0, 0);
 }
Exemple #2
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;
 }
Exemple #3
0
        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();
        }