Exemplo n.º 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;
                                      }
                                  };
        }
Exemplo n.º 2
0
 public CControl(GSGame mGame, CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender)
 {
     _game = mGame;
     _cBody = mCBody;
     _cMovement = mCMovement;
     _cTargeter = mCTargeter;
     _cRender = mCRender;
 }
Exemplo n.º 3
0
 private CControl Control(CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender)
 {
     return new CControl(_game, mCBody, mCMovement, mCTargeter, mCRender);
 }
Exemplo n.º 4
0
 private CAI AI(CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender, bool mBig = false)
 {
     return new CAI(_game, mCBody, mCMovement, mCTargeter, mCRender, mBig);
 }