예제 #1
0
    public bool IsCollide(MZCharacterPart other)
    {
        foreach( MZCollision selfCollision in collisionsList )
        {
            foreach( MZCollision otherCollision in other.collisionsList )
            {
                if( selfCollision.IsCollision( otherCollision ) )
                {
                    return true;
                }
            }
        }

        return false;
    }
예제 #2
0
    void AddOddWayAttack(MZCharacterPart part, MZMode mode)
    {
        MZPartControl partControl = new MZPartControl( part );
        MZControlUpdate<MZPartControl> partControlUpdate = mode.AddPartControlUpdater();
        partControlUpdate.Add( partControl );

        MZAttack_OddWay attack = partControl.AddAttack<MZAttack_OddWay>();
        attack.numberOfWays = 1;
        attack.colddown = 0.3f;
        attack.duration = 0.1f;
        attack.initVelocity = 500;
        attack.bulletName = "EBDonuts";
        attack.targetHelp = new MZTargetHelp_Target();

        MZAttack_Idle idle = partControl.AddAttack<MZAttack_Idle>();
        idle.duration = 3;
    }
    void AddCrossWayAttack(MZCharacterPart part, MZMode mode, float degree, int way)
    {
        MZPartControl partControl = new MZPartControl( part );
        mode.AddPartControlUpdater().Add( partControl );

        float rankIdle = ( ( rank < 3 )? 0.5f : 0 );

        MZAttack_OddWay odd = partControl.AddAttack<MZAttack_OddWay>();
        odd.numberOfWays = way;
        odd.colddown = 0.1f;
        odd.duration = 1.0f - rankIdle + ( ( rank >= 7 )? -0.6f : 0 );
        odd.bulletName = "EBDonuts";
        odd.initVelocity = 300;
        odd.additionalVelocity = 80;
        odd.targetHelp = MZTargetHelp.Create<MZTargetHelp_AssignDirection>();
        ( odd.targetHelp as MZTargetHelp_AssignDirection ).direction = degree;
        float interval = 50;
        odd.offsetPositionsList.Add( new Vector2( 0, -interval ) );
        odd.offsetPositionsList.Add( new Vector2( -interval, 0 ) );
        odd.offsetPositionsList.Add( new Vector2( interval, 0 ) );

        MZAttack_Idle idle = partControl.AddAttack<MZAttack_Idle>();
        idle.duration = 0.6f + rankIdle;
    }