Exemplo n.º 1
0
    public virtual void LoadPlayer()
    {
        attackBox = new AttkBox(MOVENUM);
        hitbox = new HitBox();

        stats.LoadStats(STATS_FILE);
        attackBox.LoadFromScript(SCRIPT_FILE, 1, stats.size.y);
        LoadMoveScript(MOVESCRIPT);

        stats.id.num = plNum;//todo not hard code

        attackBox.grabRange = stats.grabRange;
        hitbox = new HitBox();
        fHelper = new NinjaHelper ();
        SetPlayer();
        transform.Rotate(0, 90.0f, 0);
        fHelper.Animate("Idle", true, 0);
        FindPNum();
        hitbox.AllocateFirstIndices(1);//for a 1 dimensional array of vertices
        hitbox.AllocateSecondIndices(0, 4);
        hitbox.SetVertex(-stats.size.x/2, 0, 0, 3);
        hitbox.SetVertex(stats.size.x/2, 0, 0, 2);
        hitbox.SetVertex(stats.size.x/2, stats.size.y, 0, 1);
        hitbox.SetVertex(-stats.size.x/2, stats.size.y, 0, 0);

        //pPtcl.LoadParticles(eng, stats.id.num, "Yara");

        //LoadMoveScript(MOVESCRIPT);
    }
Exemplo n.º 2
0
    /*void LoadMoveScript(string s){

        int endL, enPos;
        float dVal;
    std:string par, val, line;
        ifstream infile;//get the polygon count for the arrays
        infile.open(s);
        if (infile.is_open()){
            while ( infile.good() ){
                getline (infile,line);
                endL = line.length()-1;
                enPos = line.find_first_of("=");
                par = line.substr(0, enPos);
                val = line.substr(enPos+1, line.length());
                dVal = atof(val.c_str());
                if(par.compare("scSpeed") == 0)
                    scSpd=dVal;
            }
        }

    }*/
    bool LoadPlayer()
    {
        FindPNum ();

        attackBox = new AttkBox ();
        hitbox = new HitBox();

        hitbox.AllocateFirstIndices(1);//for a 1 dimensional array of vertices
        hitbox.AllocateSecondIndices(0, 4);
        hitbox.SetVertex(-stats.size.x/2, 0, 0, 3);
        hitbox.SetVertex(stats.size.x/2, 0, 0, 2);
        hitbox.SetVertex(stats.size.x/2, stats.size.y, 0, 1);
        hitbox.SetVertex(-stats.size.x/2, stats.size.y, 0, 0);
        fHelper.grabBox = new HitBox();
        fHelper.grabBox.AllocateFirstIndices(1);
        fHelper.grabBox.AllocateSecondIndices(0, 4);
        fHelper.grabBox.SetVertex(-stats.size.x/2, stats.size.y + stats.edgegrab.hgt, 0, 0);
        fHelper.grabBox.SetVertex(-stats.size.x/2, stats.size.y, 0, 3);
        fHelper.grabBox.SetVertex(-stats.size.x/2 - stats.edgegrab.wid, stats.size.y, 0, 2);
        fHelper.grabBox.SetVertex(-stats.size.x/2 - stats.edgegrab.wid, stats.size.y + stats.edgegrab.hgt, 0, 16);
        fHelper.grabBox.isActive = false;
        fHelper.sScale=1;
        //fHelper.Load(eng, MESH_FILE, GetPos());
        stats.LoadStats(STATS_FILE);

        attackBox.LoadFromScript(SCRIPT_FILE, fHelper.sScale, stats.size.y);

        stats.id.num = plNum;//todo not hard code
        SetPlayer ();
        transform.Rotate (0, 90.0f, 0);
        fHelper.Animate ("Idle", true, 0);
        LoadMoveScript (MOVE_FILE);

        //

        //psysword.Load( PSYSWORD_MESH_FILE, GetPos());//load sword model
        //psysword.LoadAnimHolder( PSYSWORD_ANIMHELP, GetPos());//load serenity's anims for reference
        psysword.attackBox.LoadFromScript(SCRIPT_FILE, fHelper.sScale, stats.size.y);
        SPoint bT = new SPoint(0, -psysword.stats.size.y);

        psysword.attackBox.TranslateAttack(bT, NB);
        psysword.attackBox.TranslateAttack(bT, SB);
        psysword.attackBox.TranslateAttack(bT, UB);
        psysword.attackBox.TranslateAttack(bT, DB);

        //LoadMoveScript(MOVESCRIPT);
        return true;
    }