Example #1
0
 public override BLRunStatus Run(BulletMLBullet bullet)
 {
     bullet.Vanish();
     End = true;
     //if(bullet.index == DISP_BULLET_INDEX) Debug.WriteLine("Vanish");
     return BLRunStatus.End;
 }
Example #2
0
 public override BLRunStatus Run(BulletMLBullet bullet)
 {
     bullet.Speed = node.GetValue(this);
     //if(bullet.index == DISP_BULLET_INDEX) Debug.WriteLine("SetSpeed:" + bullet.Speed);
     End = true;
     return BLRunStatus.End;
 }
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            if (first)
            {
                first = false;
                if(node.GetChild(BLName.Speed).Type == BLType.Sequence)
                {
                    changeSpeed = node.GetChildValue(BLName.Speed, this);
                }
                else if(node.GetChild(BLName.Speed).Type == BLType.Relative)
                {
                    changeSpeed = node.GetChildValue(BLName.Speed, this) / term;
                }
                else
                {
                    changeSpeed = (node.GetChildValue(BLName.Speed, this) - bullet.Speed) / term;
                }
            }

            term--;

            bullet.Speed += changeSpeed;

            // if (bullet.index == DISP_BULLET_INDEX)  Debug.WriteLine(String.Format("ChangeSpeed:{0} (type:{1} val:{2})", bullet.Speed, node.GetChild(BLName.Speed).type, node.GetChildValue(BLName.Speed, this)));

            if (term <= 0)
            {
                End = true;
                return BLRunStatus.End;
            }
            else
            {
                return BLRunStatus.Continue;
            }
        }
Example #4
0
 public override BLRunStatus Run(BulletMLBullet bullet)
 {
     bullet.Speed = node.GetValue(this);
     //if(bullet.index == DISP_BULLET_INDEX) Debug.WriteLine("SetSpeed:" + bullet.Speed);
     End = true;
     return(BLRunStatus.End);
 }
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            if (first)
            {
                first = false;
                if (node.GetChild(BLName.Speed).Type == BLType.Sequence)
                {
                    changeSpeed = node.GetChildValue(BLName.Speed, this);
                }
                else if (node.GetChild(BLName.Speed).Type == BLType.Relative)
                {
                    changeSpeed = node.GetChildValue(BLName.Speed, this) / term;
                }
                else
                {
                    changeSpeed = (node.GetChildValue(BLName.Speed, this) - bullet.Speed) / term;
                }
            }

            term--;

            bullet.Speed += changeSpeed;

            // if (bullet.index == DISP_BULLET_INDEX)  Debug.WriteLine(String.Format("ChangeSpeed:{0} (type:{1} val:{2})", bullet.Speed, node.GetChild(BLName.Speed).type, node.GetChildValue(BLName.Speed, this)));

            if (term <= 0)
            {
                End = true;
                return(BLRunStatus.End);
            }
            else
            {
                return(BLRunStatus.Continue);
            }
        }
Example #6
0
 public override BLRunStatus Run(BulletMLBullet bullet)
 {
     bullet.Vanish();
     End = true;
     //if(bullet.index == DISP_BULLET_INDEX) Debug.WriteLine("Vanish");
     return(BLRunStatus.End);
 }
Example #7
0
 public void Init(BulletMoverManager myManager, Icon icon)
 {
     this.myManager = myManager;
     this.icon      = icon;
     IsUsed         = true;
     IsBulletRoot   = false;
     MLBullet       = new BulletMLBullet(this);
     //collidableComponents.Add(this);
 }
Example #8
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            while (repeatNum < repeatNumMax)
            {
                BLRunStatus runStatus = base.Run(bullet);

                if (runStatus == BLRunStatus.End)
                {
                    repeatNum++;
                    base.Init();
                }
                else if (runStatus == BLRunStatus.Stop)
                {
                    return(BLRunStatus.Stop);// BLRunStatus.Stop;
                }
                else
                {
                    return(BLRunStatus.Continue);// BLRunStatus.Stop;
                }
            }

            End = true;
            return(BLRunStatus.End);

            //if (repeatNum < repeatNumMax)
            //{
            //    BLRunStatus runStatus = base.Run(bullet);
            //    if (runStatus == BLRunStatus.End)
            //    {
            //        repeatNum++;
            //        //if (bullet.index == DISP_BULLET_INDEX) Debug.WriteLine(String.Format("Repeat: {0} / {1}", repeatNum, repeatNumMax));
            //        base.Init();
            //        if (repeatNum == repeatNumMax)
            //        {
            //            end = true;
            //            return BLRunStatus.End;
            //        }
            //        else
            //            return BLRunStatus.Stop;// Continue;
            //    }
            //    else if (runStatus == BLRunStatus.Stop)
            //        return BLRunStatus.Stop;
            //    else
            //        return BLRunStatus.Stop;// BLRunStatus.Continue;
            //}
            //else
            //{
            //    end = true;
            //    return BLRunStatus.End;
            //}
        }
Example #9
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            if (first)
            {
                first = false;
                term  = node.GetChildValue(BLName.Term, this);
                if (node.Type == BLType.Sequence)
                {
                    horizontalAccel = node.GetChildValue(BLName.Horizontal, this);
                    verticalAccel   = node.GetChildValue(BLName.Vertical, this);
                }
                else if (node.Type == BLType.Relative)
                {
                    horizontalAccel = node.GetChildValue(BLName.Horizontal, this) / term;
                    verticalAccel   = node.GetChildValue(BLName.Vertical, this) / term;
                }
                else
                {
                    // speedX = (float)(bullet.speed * Math.Sin(bullet.Direction));
                    // speedY = (float)(bullet.speed * Math.Cos(bullet.Direction));
                    horizontalAccel = (node.GetChildValue(BLName.Horizontal, this) - bullet.speedX) / term;
                    verticalAccel   = (node.GetChildValue(BLName.Vertical, this) - bullet.speedY) / term;
                }
            }

            term--;
            if (term < 0)
            {
                End = true;
                return(BLRunStatus.End);
            }

            bullet.speedX += horizontalAccel;
            bullet.speedY += verticalAccel;

            //Debug.WriteLine(String.Format("accel speedX={0} speedY={1} verAcl={2} horAcl={3} term={4}", bullet.speedX, bullet.speedY, verticalAccel, horizontalAccel, term));

            /*
             * double speedX = bullet.speed * Math.Sin(bullet.Direction);
             * double speedY = bullet.speed * Math.Cos(bullet.Direction);
             * speedX += horizontalAccel;
             * speedY += verticalAccel;
             *
             * bullet.Direction = (float)Math.Atan2(speedX ,speedY);
             * bullet.speed = (float)Math.Sqrt(speedX * speedX + speedY * speedY);
             * //Debug.WriteLine("accel speed={0} dir={1} verAcl={2} horAcl={3} term={4}", bullet.speed, bullet.Direction / Math.PI * 180, verticalAccel, horizontalAccel, term); */
            return(BLRunStatus.Continue);
        }
Example #10
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            if( first )
            {
                first = false;
                term = node.GetChildValue(BLName.Term, this);
                if(node.Type == BLType.Sequence)
                {
                    horizontalAccel = node.GetChildValue(BLName.Horizontal, this);
                    verticalAccel = node.GetChildValue(BLName.Vertical, this);
                }
                else if(node.Type == BLType.Relative)
                {
                    horizontalAccel = node.GetChildValue(BLName.Horizontal, this) / term;
                    verticalAccel   = node.GetChildValue(BLName.Vertical, this) / term;
                }
                else
                {
                    // speedX = (float)(bullet.speed * Math.Sin(bullet.Direction));
                    // speedY = (float)(bullet.speed * Math.Cos(bullet.Direction));
                    horizontalAccel = (node.GetChildValue(BLName.Horizontal, this) - bullet.speedX) / term;
                    verticalAccel = (node.GetChildValue(BLName.Vertical, this) - bullet.speedY) / term;
                }
            }

            term--;
            if (term < 0)
            {
                End = true;
                return BLRunStatus.End;
            }

            bullet.speedX += horizontalAccel;
            bullet.speedY += verticalAccel;

            //Debug.WriteLine(String.Format("accel speedX={0} speedY={1} verAcl={2} horAcl={3} term={4}", bullet.speedX, bullet.speedY, verticalAccel, horizontalAccel, term));

            /*
            double speedX = bullet.speed * Math.Sin(bullet.Direction);
            double speedY = bullet.speed * Math.Cos(bullet.Direction);
            speedX += horizontalAccel;
            speedY += verticalAccel;

            bullet.Direction = (float)Math.Atan2(speedX ,speedY);
            bullet.speed = (float)Math.Sqrt(speedX * speedX + speedY * speedY);
            //Debug.WriteLine("accel speed={0} dir={1} verAcl={2} horAcl={3} term={4}", bullet.speed, bullet.Direction / Math.PI * 180, verticalAccel, horizontalAccel, term); */
            return BLRunStatus.Continue;
        }
Example #11
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            while(repeatNum < repeatNumMax)
            {
                BLRunStatus runStatus = base.Run(bullet);

                if (runStatus == BLRunStatus.End)
                {
                    repeatNum++;
                    base.Init();
                }
                else if (runStatus == BLRunStatus.Stop)
                    return BLRunStatus.Stop;// BLRunStatus.Stop;
                else
                    return BLRunStatus.Continue;// BLRunStatus.Stop;
            }

            End = true;
            return BLRunStatus.End;

            //if (repeatNum < repeatNumMax)
            //{
            //    BLRunStatus runStatus = base.Run(bullet);
            //    if (runStatus == BLRunStatus.End)
            //    {
            //        repeatNum++;
            //        //if (bullet.index == DISP_BULLET_INDEX) Debug.WriteLine(String.Format("Repeat: {0} / {1}", repeatNum, repeatNumMax));
            //        base.Init();
            //        if (repeatNum == repeatNumMax)
            //        {
            //            end = true;
            //            return BLRunStatus.End;
            //        }
            //        else
            //            return BLRunStatus.Stop;// Continue;
            //    }
            //    else if (runStatus == BLRunStatus.Stop)
            //        return BLRunStatus.Stop;
            //    else
            //        return BLRunStatus.Stop;// BLRunStatus.Continue;
            //}
            //else
            //{
            //    end = true;
            //    return BLRunStatus.End;
            //}
        }
Example #12
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            if (term >= 0)
            {
                term--;
            }

            //if (term >= 0) if (bullet.index == DISP_BULLET_INDEX)  Debug.WriteLine("Wait " + term);

            if (term >= 0)
                return BLRunStatus.Stop;
            else
            {
                End = true;
                return BLRunStatus.End;
            }
        }
Example #13
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            if (term >= 0)
            {
                term--;
            }

            //if (term >= 0) if (bullet.index == DISP_BULLET_INDEX)  Debug.WriteLine("Wait " + term);

            if (term >= 0)
            {
                return(BLRunStatus.Stop);
            }
            else
            {
                End = true;
                return(BLRunStatus.End);
            }
        }
Example #14
0
 public void Init()
 {
     used       = true;
     bulletRoot = false;
     mlBullet   = new BulletMLBullet(this);
 }