Exemple #1
0
        public CAI(GSGame mGame, CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender, bool mBig)
        {
            _game = mGame;
            _cBody = mCBody;
            _cTargeter = mCTargeter;
            _cMovement = mCMovement;
            _cRender = mCRender;
            _shootDelay = Utils.Random.Next(0, 80);
            _big = mBig;

            if (_big)
            {
                _shootDelayMax = 150;
                _speedMax = 60;
            }

            mCBody.OnCollision += (mCollisionInfo) =>
                                  {
                                      var entity = (Entity)mCollisionInfo.UserData;

                                      if (entity.HasTag(Tags.Wall))
                                      {
                                          _angle += 180 + Utils.Random.Next(-45, 45);
                                          _speed = Utils.Random.Next(0, 100);
                                          _rotationSpeed = 0.002f;
                                      }
                                  };
        }
 public CControl(GSGame mGame, CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender)
 {
     _game = mGame;
     _cBody = mCBody;
     _cMovement = mCMovement;
     _cTargeter = mCTargeter;
     _cRender = mCRender;
 }
 public CPurification(GSGame mGame, CRender mCRender)
 {
     _game = mGame;
     _cRender = mCRender;
     _shootDelay = Utils.Random.Next(0, 100);
 }
 private CPurification Purification(CRender mCRender)
 {
     return new CPurification(_game, mCRender);
 }
 private CControl Control(CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender)
 {
     return new CControl(_game, mCBody, mCMovement, mCTargeter, mCRender);
 }
 private CAI AI(CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender, bool mBig = false)
 {
     return new CAI(_game, mCBody, mCMovement, mCTargeter, mCRender, mBig);
 }