Ejemplo n.º 1
0
        /// <summary>
        /// This bullet is fired from another bullet, initialize it from the node that fired it
        /// </summary>
        /// <param name="subNode">Sub node that defines this bullet</param>
        public void InitNode(BulletMLNode subNode)
        {
            Debug.Assert(null != subNode);

            //clear everything out
            Tasks.Clear();

            //Grab that top level node
            MyNode = subNode;

            //found a top num node, add a task for it
            BulletMLTask task = new BulletMLTask(subNode, null);

            //parse the nodes into the task list
            task.ParseTasks(this);

            //initialize all the tasks
            task.InitTask(this);

            Tasks.Add(task);

            //Check if we should change the start heading and speed to adjust for an initial velocity
            if (Vector2.Zero != InitialVelocity)
            {
                //now that the heading and speed have been set, adjust them according to the initial velocity.
                Vector2 final = (Direction.ToVector2() * Speed * Scale) + InitialVelocity;
                Direction = final.Angle();
                Speed     = final.Length() / Scale;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This bullet is fired from another bullet, initialize it from the node that fired it
        /// </summary>
        /// <param name="subNode">Sub node that defines this bullet</param>
        public void InitNode(BulletMLNode subNode)
        {
            Debug.Assert(null != subNode);

            //clear everything out
            Tasks.Clear();

            //Grab that top level node
            MyNode = subNode;

            //found a top num node, add a task for it
            BulletMLTask task = new BulletMLTask(subNode, null);

            //parse the nodes into the task list
            task.ParseTasks(this);

            //initialize all the tasks
            task.InitTask(this);

            Tasks.Add(task);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This bullet is fired from another bullet, initialize it from the node that fired it
        /// </summary>
        /// <param name="subNode">Sub node that defines this bullet</param>
        public void InitNode(BulletMLNode subNode)
        {
            System.Diagnostics.Debug.Assert(null != subNode);

              //clear everything out
              Tasks.Clear();

              //Grab that top level node
              MyNode = subNode;

              //found a top num node, add a task for it
              BulletMLTask task = new BulletMLTask(subNode, null);

              //parse the nodes into the task list
              task.ParseTasks(this);

              //initialize all the tasks
              task.InitTask(this);

              Tasks.Add(task);
        }