Example #1
0
        public virtual void AddObject(GameObject obj)
        {
            if (obj is MovingObjects)
            {
                this.AddMovingObject(obj as MovingObjects);
            }
            else
            {
                if (obj is Spaceship)
                {
                    AddSpaceship(obj);

                }
                else if (obj is Alien)
                {
                    AddAlien(obj);
                }
                else
                {
                    this.AddStaticObject(obj);
                }
            }
        }
Example #2
0
 private void AddSpaceship(GameObject obj)
 {
     this.playerSpaceship = obj as Spaceship;
     this.AddStaticObject(obj);
 }
Example #3
0
 private void AddStaticObject(GameObject obj)
 {
     this.staticObjects.Add(obj);
     this.allObjects.Add(obj);
 }
Example #4
0
 private void AddAlien(GameObject obj)
 {
     this.playerAlien = obj as Alien;
     this.AddStaticObject(obj);
 }