コード例 #1
0
ファイル: CAI.cs プロジェクト: SuperV1234/TestGenericShooter
        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;
                                      }
                                  };
        }
コード例 #2
0
 public CControl(GSGame mGame, CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender)
 {
     _game = mGame;
     _cBody = mCBody;
     _cMovement = mCMovement;
     _cTargeter = mCTargeter;
     _cRender = mCRender;
 }
コード例 #3
0
 public CPurification(GSGame mGame, CRender mCRender)
 {
     _game = mGame;
     _cRender = mCRender;
     _shootDelay = Utils.Random.Next(0, 100);
 }
コード例 #4
0
 private CPurification Purification(CRender mCRender)
 {
     return new CPurification(_game, mCRender);
 }
コード例 #5
0
 private CControl Control(CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender)
 {
     return new CControl(_game, mCBody, mCMovement, mCTargeter, mCRender);
 }
コード例 #6
0
 private CAI AI(CBody mCBody, CMovement mCMovement, CTargeter mCTargeter, CRender mCRender, bool mBig = false)
 {
     return new CAI(_game, mCBody, mCMovement, mCTargeter, mCRender, mBig);
 }