Exemplo n.º 1
0
        public override void Shoot(Layer weaponLayer)
        {
            if(master.LockShip ==null)
            {
                DebugScene.Instance.WriteLine("No Enemy","No Enemy is Locked!");
                return;
            }

            if (shootCd.IsOver == true && Amount >0)
            {
                if (OnceAmount == 2)
                {
                    BMissile b1 = new BMissile (weaponLayer, master.GetPosition (), master.LockShip, speed, rots, rotsInc, width, height, this.WeaponRangeType, ctype,
                            Att, "Battles//testwingman.png");
                    b1.Body.Rotate (master.NowAngle - 1.57f);
                    BMissile b2 = new BMissile (weaponLayer, master.GetPosition (), master.LockShip, speed, rots, rotsInc, 8, 8, this.WeaponRangeType, ctype,
                            Att, "Battles//testwingman.png");
                    b2.Body.Rotate (master.NowAngle + 1.57f);
                    shootCd.Start ();
                }
                else
                {
                    DebugScene.Instance.WriteLine("Noasdmy","发射导弹失败…………");
                }
                base.Shoot(weaponLayer);
            }
        }
Exemplo n.º 2
0
        public override void Shoot(Layer weaponLayer)
        {
            if (master.LockShip == null)
            {
                DebugScene.Instance.WriteLine("No Enemy", "No Enemy is Locked!");
                return;
            }

            if (shootCd.IsOver == true && Amount > 0)
            {
                if (OnceAmount == 2)
                {
                    BMissile b1 = new BMissile(weaponLayer, master.GetPosition(), master.LockShip, speed, rots, rotsInc, width, height, this.WeaponRangeType, ctype,
                                               Att, "Battles//testwingman.png");
                    b1.Body.Rotate(master.NowAngle - 1.57f);
                    BMissile b2 = new BMissile(weaponLayer, master.GetPosition(), master.LockShip, speed, rots, rotsInc, 8, 8, this.WeaponRangeType, ctype,
                                               Att, "Battles//testwingman.png");
                    b2.Body.Rotate(master.NowAngle + 1.57f);
                    shootCd.Start();
                }
                else
                {
                    DebugScene.Instance.WriteLine("Noasdmy", "发射导弹失败…………");
                }
                base.Shoot(weaponLayer);
            }
        }