Esempio n. 1
0
 private void HandlePlayer(Point currentPoint, Color dotColor, Color[] colorData, Level level)
 {
     Point position = GetCenterPoint(currentPoint, dotColor, colorData);
     PlayerCell player = new PlayerCell(PlayWindow, PointToPosition(position));
     level.SetPlayer(player);
 }
Esempio n. 2
0
        private void LoadLevel(String file)
        {
            World.Clear();
            GoodCellList.Clear();
            VirusList.Clear();

            _level = _levelParser.Parse(Texture2D.FromStream(Game1.graphics.GraphicsDevice, new FileStream(file, FileMode.Open)));
            _wallList = _level.GetWalls();

            foreach (var item in _level.GetFriendlies())
            {
                GoodCellList.Add((GoodCell)item);
            }

            foreach (var item in _level.GetEnemies())
            {
                VirusList.Add((Virus)item);
            }

            _objectList = _level.GetFriendlies();
            _objectList.AddRange(_level.GetEnemies());

            _player = _level.Player;
        }
Esempio n. 3
0
        private void TestInit()
        {
            World = new World(Vector2.Zero);

            _objectList = new List<ActiveGameObject>();

            _player = new PlayerCell(this, new Vector2(0));

            GoodCell goodCell = new GoodCell(this, new Vector2(300, 100));
            GoodCellList.Add(goodCell);
            _objectList.Add(goodCell);
            _objectList.Add(new Virus(this, new Vector2(200, -200)));

            //Vertices vertices = new Vertices();
            //vertices.Add(new Vector2(-300, -200));
            //vertices.Add(new Vector2(-200, -150));
            //vertices.Add(new Vector2(-100, -200));
            //vertices.Add(new Vector2(-160, -300));
            //vertices.Add(new Vector2(-240, -300));

            //_wallList.Add(new Wall(vertices, Wall.WallType.Outer, this));

            Vertices vertices = new Vertices();
            vertices.Add(new Vector2(-200, 200));
            vertices.Add(new Vector2(-150, 225));
            vertices.Add(new Vector2(-100, 200));
            vertices.Add(new Vector2(-125, 250));
            vertices.Add(new Vector2(-100, 300));
            vertices.Add(new Vector2(-150, 275));
            vertices.Add(new Vector2(-200, 300));
            vertices.Add(new Vector2(-175, 250));

            _wallList.Add(new Wall(vertices, Wall.WallType.Outer, this));
        }
Esempio n. 4
0
 public void SetPlayer(PlayerCell player)
 {
     Player = player;
 }