Exemple #1
0
 public void Remove(GameObjects.GameObject gameObject)
 {
     foreach (List <GameObjects.GameObject> list in collidableDictionary.Values)
     {
         list.Remove(gameObject);
     }
 }
Exemple #2
0
        public override void OnFirstUpdate(GameTime gameTime, GameObjects.GameObject gameObject)
        {
            base.OnFirstUpdate(gameTime, gameObject);

            ((IGunConfigurator)referencedBehavior).BulletTintOverride    = BulletTintOverride;
            ((IGunConfigurator)referencedBehavior).BulletTextureOverride = BulletTextureOverride;
        }
Exemple #3
0
 public void Replace(GameObjects.GameObject oldObject, GameObjects.GameObject newObject)
 {
     foreach (List <GameObjects.GameObject> list in collidableDictionary.Values)
     {
         int indexOfOldObject = list.IndexOf(oldObject);
         if (indexOfOldObject >= 0)
         {
             list[indexOfOldObject] = newObject;
         }
     }
 }
        private Matrix GetTransformation(GameObjects.GameObject gameObject, float viewWidth, float viewHeight)
        {
            Matrix transformation;
            Matrix position = Matrix.CreateTranslation(
                -gameObject.Location().X, -downwardOffset, 0);
            Matrix offset = Matrix.CreateTranslation(viewWidth / 2, 0, 0);
            Matrix zoom   = Matrix.CreateScale(this.zoom, this.zoom, 1);

            transformation = position * zoom * offset;
            return(transformation);
        }
Exemple #5
0
 public void AddToCollidables(GameObjects.GameObject gameObject)
 {
     Type[] gameObjectInterfaces = gameObject.GetType().GetInterfaces();
     foreach (Type nextInterface in gameObjectInterfaces)
     {
         foreach (Type dictionaryKey in collidableDictionary.Keys)
         {
             if (nextInterface.Equals(dictionaryKey))
             {
                 collidableDictionary[dictionaryKey].Add(gameObject);
             }
         }
     }
     RemoveExtraFireballs();
 }
        public override void UpdateOverride(Microsoft.Xna.Framework.GameTime gameTime, GameObjects.GameObject gameObject)
        {
            base.UpdateOverride(gameTime, gameObject);

            referencedBehavior.Update(gameTime, gameObject);
        }
 public override void OnFirstUpdate(Microsoft.Xna.Framework.GameTime gameTime, GameObjects.GameObject gameObject)
 {
     base.OnFirstUpdate(gameTime, gameObject);
     if (referencedBehavior == null)
     {
         referencedBehavior = (Behavior)Prototypes.All[ReferenceName].Clone();
     }
 }