예제 #1
0
파일: VictimLeaf.cs 프로젝트: AnyKey/tojam4
        public VictimLeaf(  MegaTile ParentMegaTile,
                            Animation GroundAnimation, 
                            Animation StumpAnimation, 
                            Animation ExplodeAnimation, 
                            Animation TornadoAnimation,
                            string SoundFileName,
                            Vector2 Position)
        {
            this.megatile = ParentMegaTile;
            this.GroundAnimation = GroundAnimation;
            this.StumpAnimation = StumpAnimation;
            this.ExplodeAnimation = ExplodeAnimation;
            this.TornadoAnimation = TornadoAnimation;

            this.soundHit = SoundFileName;

            GroundHealth = 0;
            TornadoHealth = 0;

            Mass = 0.1f;

            bounds = new Rectangle2D(Position.X, Position.Y, TornadoAnimation.FrameWidth, TornadoAnimation.FrameHeight);

            state = State.Flying;

            PreLoadSounds();
        }
예제 #2
0
파일: VictimUFO.cs 프로젝트: AnyKey/tojam4
        public VictimUFO(MegaTile ParentMegaTile, Animation GroundAnimation, Animation StumpAnimation, Animation ExplodeAnimation, Animation TornadoAnimation, string SoundFileName, Level ParentLevel )
        {
            this.megatile = ParentMegaTile;
            this.GroundAnimation = GroundAnimation;
            this.StumpAnimation = StumpAnimation;
            this.ExplodeAnimation = ExplodeAnimation;
            this.TornadoAnimation = TornadoAnimation;
            this.level = ParentLevel;

            removeFromMegaTileOnDeath = true;

            this.soundHit = SoundFileName;
            state = State.Ground;

            if (GroundAnimation.FrameWidth > GroundAnimation.FrameHeight)
            {
                squareDimensions = GroundAnimation.FrameWidth;
            }
            else
            {
                squareDimensions = GroundAnimation.FrameHeight;
            }

            squareDimensions *= 16;

            PreLoadSounds();

            PlaceInWorld();
        }
예제 #3
0
파일: VictimBoss.cs 프로젝트: AnyKey/tojam4
 public VictimBoss(MegaTile ParentMegaTile,
                     Animation GroundAnimation,
                     Animation StumpAnimation,
                     Animation ExplodeAnimation,
                     Animation TornadoAnimation,
                     string SoundFileName,
                     Vector2 Position)
     : base(ParentMegaTile,GroundAnimation,StumpAnimation,ExplodeAnimation,TornadoAnimation,SoundFileName,Position)
 {
 }
예제 #4
0
파일: Tornado.cs 프로젝트: AnyKey/tojam4
        public Tornado(Level level, Vector2 position, float lifeDecayRatio)
        {
            ParentLevel = level;

            // initialize variables
            Victims = new List<Victim>();
            Debris = new List<Victim>();
            Position = position;
            Velocity = new Vector2(0f, 0f);
            Acceleration = new Vector2(0f, 0f);
            RotationalSpeed = 10f;
            DamageFactor = 0f;
            Radius = 100.0f;
            TotalMass = 0.0f;
            MaxLife = 1000f;
            Life = MaxLife;
            LifeDecayRatio = lifeDecayRatio;
            Category = TornadoCategory.Gale;
            CategoryValue = 0f;
            MouseControl = new MouseControl();
            GodMode = false;

            CenterFont = ParentLevel.Game.Content.Load<SpriteFont>(@"Graphics\Font\Impact");

            // add the constant debris
            for (int i = 0; i < 20; i++)
            {
                Animation leafAnim = new Animation(ParentLevel.Game.Content.Load<Texture2D>("Graphics\\Objects\\leaf"), 10, 4, 1);
                Victim debris = new VictimLeaf(null,leafAnim,leafAnim,leafAnim,leafAnim, "", Position);

                debris.tornado = this;
                debris.state = Victim.State.Flying;
                Victims.Add(debris);
            }

            ParentLevel.Music.Play(0, true);
        }
예제 #5
0
        public VictimSkyscraper(MegaTile ParentMegaTile,
                            Animation GroundAnimation,
                            Animation StumpAnimation,
                            Animation ExplodeAnimation,
                            Animation TornadoAnimation,
                            string SoundFileName,
                            Vector2 Position)
        {
            this.megatile = ParentMegaTile;
            this.GroundAnimation = GroundAnimation;
            this.StumpAnimation = StumpAnimation;
            this.ExplodeAnimation = ExplodeAnimation;
            this.TornadoAnimation = TornadoAnimation;

            this.soundHit = SoundFileName;

            removeFromMegaTileOnDeath = false;

            bounds = new Rectangle2D(Position.X, Position.Y, GroundAnimation.FrameWidth, GroundAnimation.FrameHeight);

            state = State.Ground;

            PreLoadSounds();
        }