Exemple #1
0
        float dTB; // Distance to Ball
        //----------------------------------------------

        public Orb(Texture2D tex, Vector2 pos, Rectangle hitBox, Color c, float size, Player p, StandardEnemy enemy, StandardEnemy enemy2, DTenemy dtEnemy, AimControl aC) : base(tex, pos, hitBox)
        {
            //Declarations--------------------
            this.tex     = tex;
            this.pos     = pos;
            this.size    = size;
            this.c       = c;
            this.hitBox  = hitBox;
            this.p       = p;
            this.aC      = aC;
            this.dtEnemy = dtEnemy;
            this.enemy   = enemy;
            e2           = enemy2;
            //--------------------------------
        }
Exemple #2
0
        void LoadGame()
        {
            //Goals---------------------------------------------
            eGoal = new Goal(new Vector2(1, 450));
            pGoal = new Goal(new Vector2(1500, 450));
            //--------------------------------------------------
            //Player--------------------------------------------
            p = new Player(tM.getTexture(1), Constants.GetRandomPos(), hitBoxes, tM, eGoal);
            p.Init();
            //--------------------------------------------------

            //Enemy---------------------------------------------
            stEnemy1 = new StandardEnemy(tM.getTexture(3), new Vector2(50, 450), hitBoxes, tM, pGoal, Color.Red);
            stEnemy1.Init();
            stEnemy2 = new StandardEnemy(tM.getTexture(3), Constants.GetRandomPos(), hitBoxes, tM, pGoal, Color.Blue);
            stEnemy2.Init();

            //--------------------------------------------------

            //DecisionTree Enemy-----------------------------------------
            dtEnemy = new DTenemy(tM.getTexture(3), new Vector2(50, 450), hitBoxes, tM, pGoal, Color.Purple);
            //------------------------------------------------------------

            //Orb-----------------------------------------------
            aC  = new AimControl(tM.getTexture(5), Vector2.Zero, p);
            orb = new Orb(tM.getTexture(4), Constants.GetRandomPos(), hitBoxes, Color.Red, 0.1f, p, stEnemy1, stEnemy2, dtEnemy, aC);
            orb.Init();

            //--------------------------------------------------


            //FuSM----------------------------------------------
            //fuSM = new FuSMachine(p, orb, stEnemy1, stEnemy2, eGoal, pGoal);
            //--------------------------------------------------

            //States---------------------------------------
            gS = new GuardState(dtEnemy, orb, pGoal, eGoal);
            cS = new ChaseState(dtEnemy, orb, pGoal, eGoal);
            sS = new ScoreState(dtEnemy, orb, pGoal, eGoal);
            //--------------------------------------------------

            dtController = new DTController(dtEnemy, orb, tree, cS, gS, sS, pGoal, eGoal);
        }