Пример #1
0
        public override void pathNextNode(object sender)
        {
            MathExt.CPathNode node = (MathExt.CPathNode)sender;

            if (node.index == 1 || node.index == 4)
            {
                CMasterControl.audioPlayer.addSfx(CMasterControl.audioPlayer.soundBank["Items:bombBounce"]);
            }
        }
Пример #2
0
        private MathExt.CPathNode[] _createRightPath()
        {
            MathExt.CPathNode[] _pathPositions = new MathExt.CPathNode[5];
            _pathPositions[0] = new MathExt.CPathNode(new Vector2(_position.X + _velocity.X, _position.Y), 1);
            _pathPositions[1] = new MathExt.CPathNode(new Vector2(_position.X + _velocity.X + 2, _position.Y - 2), 1);
            _pathPositions[2] = new MathExt.CPathNode(new Vector2(_position.X + _velocity.X + 4, _position.Y), .5);
            _pathPositions[3] = new MathExt.CPathNode(new Vector2(_position.X + _velocity.X + 6, _position.Y - 2), 1);
            _pathPositions[4] = new MathExt.CPathNode(new Vector2(_position.X + _velocity.X + 7, _position.Y - 2), .5);

            return(_pathPositions);
        }
Пример #3
0
        private MathExt.CPathNode[] _createUpPath()
        {
            MathExt.CPathNode[] _pathPositions = new MathExt.CPathNode[5];
            _pathPositions[0] = new MathExt.CPathNode(new Vector2(_position.X, _position.Y - velocity.Y), 1);
            _pathPositions[1] = new MathExt.CPathNode(new Vector2(_position.X, _position.Y - velocity.Y - 2), 1);
            _pathPositions[2] = new MathExt.CPathNode(new Vector2(_position.X, _position.Y - 3 - velocity.Y), .5);
            _pathPositions[3] = new MathExt.CPathNode(new Vector2(_position.X, _position.Y - 2 - velocity.Y), 1);
            _pathPositions[4] = new MathExt.CPathNode(new Vector2(_position.X, _position.Y - 5 - velocity.Y), .5);

            return(_pathPositions);
        }
Пример #4
0
        private void _moveToNextPathNode()
        {
            MathExt.CPathNode currentNode = _path.currentNode;

            moveToPoint(currentNode.position, currentNode.speed);

            if (_position.X == currentNode.position.X && _position.Y == currentNode.position.Y)
            {
                _path.nextNode();
                onPathNextNode(_path.currentNode);
            }
        }