Ejemplo n.º 1
0
        public void Initialize(Vector2 startLocation)
        {
            IsDisposed = false;
            Location   = startLocation;

            if (Maths.Chance(50))
            {
                Direction = 1;
            }
            else
            {
                Direction = -1;
            }

            if (Maths.Chance(50) || Level.Instance.MGCnt == Level.MAX_MG_CNT)
            {
                Boom1 bm = Level.Instance.BoomPool.New();
                bm.Initialize(new Vector2(Animation.Width / 2 - 9, Animation.Height / 2), null);
                Guns.Add(bm);
            }
            else
            {
                MG1 mg = Level.Instance.MGPool.New();
                mg.Initialize(new Vector2(Animation.Width / 2 - 4 - 10, Animation.Height), new Vector2(Animation.Width / 2 - 4 + 10, Animation.Height), null);
                Guns.Add(mg);
                Level.Instance.MGCnt++;
            }
        }
        public void Initialize(Vector2 startLoc)
        {
            IsDisposed = false;
            Location   = startLoc;

            DualMissile45 d45 = Level.Instance.DualMissile45Pool.New();

            d45.Initialize(new Vector2(10, 31), null);
            Guns.Add(d45);
        }
        public void Initialize(Vector2 startLocation)
        {
            IsDisposed = false;
            Location   = startLocation;

            Velocity = Maths.RandomNr(7, 9);
            AutoAim aa = Level.Instance.AutoAimPool.New();

            aa.Initialize(new Vector2(Animation.Width / 2 - 8, Animation.Height / 2 - 8), null);
            Guns.Add(aa);
        }
Ejemplo n.º 4
0
        public void Initialize(Vector2 startLocation)
        {
            IsDisposed = false;
            Location   = startLocation;

            DualMissile45 d45 = Level.Instance.DualMissile45Pool.New();

            d45.Initialize(new Vector2(20, 30), null);
            Guns.Add(d45);

            Missile ms = Level.Instance.MissilePool.New();

            ms.Initialize(new Vector2(21, 40), null);
            Guns.Add(ms);
        }
        /// <summary>
        /// Call this after getting me from the pool.
        /// </summary>
        /// <param name="startLoc"></param>
        public void Initialize(Vector2 startLoc)
        {
            IsDisposed = false;
            Location   = startLoc;

            int  rndWpn;
            bool pass;

            do
            {
                pass   = true;
                rndWpn = Maths.RandomNr(1, 100);
                if (rndWpn < 30)
                {
                    AutoAim aa = Level.Instance.AutoAimPool.New();
                    aa.Initialize(new Vector2(Animation.Width / 2 - 8, Animation.Height / 2 - 8), null);
                    Guns.Add(aa);
                    Velocity = 2.4f;
                }
                else if (rndWpn < 70)
                {
                    Boom1 bm = Level.Instance.BoomPool.New();
                    bm.Initialize(new Vector2(Animation.Width / 2 - 9, Animation.Height / 2), null);
                    Guns.Add(bm);
                    Velocity = 3f;
                }
                else
                {
                    if (Level.Instance.MGCnt < Level.MAX_MG_CNT)
                    {
                        Level.Instance.MGCnt++;
                        Velocity = 3f;
                        MG1 mg = Level.Instance.MGPool.New();
                        mg.Initialize(new Vector2(Animation.Width / 2 - 4 - 10, Animation.Height), new Vector2(Animation.Width / 2 - 4 + 10, Animation.Height), null);
                        Guns.Add(mg);
                    }
                    else
                    {
                        pass = false;
                    }
                }
            } while (!pass);
        }