예제 #1
0
        public override void Intersect(InteractiveModel interactive)
        {
            if (this == interactive || hasBeenVisited == true)
            { return; }

            if (interactive.GetType().IsSubclassOf(typeof(Ant)))
            {
                if (this.model.BoundingSphere.Intersects(interactive.Model.BoundingSphere))
                    hasBeenVisited = true;
            }
        }
예제 #2
0
        public override void Intersect(InteractiveModel interactive)
        {
            if (this == interactive)
            { return; }
            foreach (BoundingSphere b in model.Spheres)
            {

                foreach (BoundingSphere b2 in interactive.Model.Spheres)
                {

                    if (b.Intersects(b2))
                    {
                        if (gaterMaterialObject == interactive)
                        {
                            if (interactive.GetType().BaseType == typeof(Material))
                            {
                                if (gaterTime < elapsedTime)
                                {
                                    gaterMaterial((Material)interactive);

                                }
                            }
                        }
                        else if (interactive.GetType() == typeof(AntGranary))
                        {
                            Console.WriteLine("Oddaje");
                            //AntHill.Player.addMaterial(releaseMaterial());
                            this.materials.Clear();
                            Console.WriteLine(Capacity);
                        }

                    }

                }
            }
        }
예제 #3
0
        public override void Intersect(InteractiveModel interactive)
        {
            base.Intersect(interactive);
            if (this == interactive)
            { return; }

            if (interactive.GetType().IsSubclassOf(typeof(Material)))
            {
                if (model.BoundingSphere.Intersects(interactive.Model.BoundingSphere))
                {
                    if (gaterMaterialObject == interactive)
                    {

                        if (gaterTime < elapsedTime)
                        {
                            ImGatering = true;
                            gaterMaterial((Material)gaterMaterialObject);
                           // SoundController.SoundController.Play(SoundController.SoundEnum.Gater);
                            Logic.Player.Player.addMaterial(releaseMaterial());
                            materials.Clear();
                        }

                    }

                }

            }
        }
예제 #4
0
        public void Hit(InteractiveModel b)
        {
            if (b.GetType()==typeof(EnviroModel.Cone) || b.GetType()==typeof(EnviroModel.Cone1))
                {
                    if (b.Hp > 0)
                    {
                        b.Hp -= 1;
                        Console.WriteLine("Niszcze szyszke!");
                        ((EnviroModel.EnviroModels)b).LifeBar.LifeLength -= 1;
                        b.hasBeenHit = true;
                        b.Model.Hit = true;
                        b.Model.Rotation -= new Vector3(0, 0.1f, 0);

                        b.Model.Position -= new Vector3(0, 0, 1f);

                    }
                   }
        }
예제 #5
0
 public void Hit(InteractiveModel b)
 {
     if(b.GetType().IsSubclassOf(typeof(Unit)) )
     {
     b.Hp -= 10;
     ((Unit)b).LifeBar.LifeLength -= ((Unit)b).LifeBar.LifeLength * ((10)/b.MaxHp );
     b.hasBeenHit = true;
     b.Model.Hit = true;
        // SoundController.SoundController.Play(SoundController.SoundEnum.RangeHit);
     }
 }