Beispiel #1
0
        protected void AddRink()
        {
            if (GameObjects.Count(x => x.Model.IsGameWorld) > 0)
            {
                return;
            }

            GameObject _rink = new GameObject();

            _rink.ApplyPhysics      = false;
            _rink.Model.ModelFile   = "rink.3ds";
            _rink.Scale             = new Vector3D(30, 30, 30);
            _rink.Position          = new Vector3D(15, 50, -1);
            _rink.Model.IsGameWorld = true;

            ModelMaterial ice = new ModelMaterial();

            ice.TextureFile   = "rink.3ds.png";
            ice.MeshIndex     = 0;
            ice.SpecularPower = 15000;
            ice.SpecularColor = Color.FromRgb(255, 255, 255);

            ModelMaterial glass = new ModelMaterial();

            glass.Opacity   = .12;
            glass.MeshIndex = 2;

            _rink.Model.Materials.Add(glass);
            _rink.Model.Materials.Add(ice);

            GameObjects.Add(_rink);
        }
Beispiel #2
0
        public void CleanUp()
        {
            while (GameObjects.Count() > 0)
            {
                GameObjects.RemoveAt(0);
            }

            while (HUDItems.Count() > 0)
            {
                HUDItems.RemoveAt(0);
            }
        }
Beispiel #3
0
        public void Update()
        {
            CommandManager.CreateNewRoster();
            UpdateGameObjects();

            if (GameObjects.Count(gameObject =>
                                  gameObject.ObjectType != ObjectType.PlayerBullet &&
                                  gameObject.ObjectType != ObjectType.BomberShipBullet &&
                                  gameObject.ObjectType != ObjectType.Blast) < 2)
            {
                GenerateEnemies();
            }

            if (PlayerShip.Health < 1)
            {
                CurrentState = defeatState;
            }
        }
 public int GetCountByObjectName(string objectName) => GameObjects
 .Count(e => e.Value.ObjectTypeName
        .Equals(objectName, System.StringComparison.OrdinalIgnoreCase));
Beispiel #5
0
 public int GetPointCount(int x, int y)
 {
     return(GameObjects.Count(obj => obj.X == x && obj.Y == y));
 }