Inheritance: VeeEntity.Component
Ejemplo n.º 1
0
 public CLineOfSight(SPGame mGame, CBody mCBody, CShadower mCShadower)
 {
     _game = mGame;
     _cBody = mCBody;
     _cShadower = mCShadower;
     Targets = new HashSet<Tuple<Entity, SSVector2I>>();
 }
Ejemplo n.º 2
0
 public CControl(SPGame mGame, CStats mCStats, CBody mCBody, CMovement mCMovement, CRender mCRender)
 {
     _game = mGame;
     _cStats = mCStats;
     _cBody = mCBody;
     _cMovement = mCMovement;
     _cRender = mCRender;
 }
Ejemplo n.º 3
0
        public CChild(Entity mParent, CBody mCBody)
        {
            _parent     = mParent;
            _cBody      = mCBody;
            _parentBody = _parent.GetComponentUnSafe <CBody>();

            _parent.OnDestroy += () => Entity.Destroy();
        }
Ejemplo n.º 4
0
 public CControl(SPGame mGame, CStats mCStats, CBody mCBody, CMovement mCMovement, CRender mCRender)
 {
     _game      = mGame;
     _cStats    = mCStats;
     _cBody     = mCBody;
     _cMovement = mCMovement;
     _cRender   = mCRender;
 }
Ejemplo n.º 5
0
        public CChild(Entity mParent, CBody mCBody)
        {
            _parent = mParent;
            _cBody = mCBody;
            _parentBody = _parent.GetComponentUnSafe<CBody>();

            _parent.OnDestroy += () => Entity.Destroy();
        }
Ejemplo n.º 6
0
 public CRender(SPGame mGame, CBody mCBody, string mTextureName, string mTilesetName = null,
                string mLabelName = null, float mRotation = 0)
 {
     _game = mGame;
     _cBody = mCBody;
     _textureName = mTextureName;
     _tilesetName = mTilesetName;
     _labelName = mLabelName;
     _rotation = mRotation;
 }
Ejemplo n.º 7
0
 public CRender(SPGame mGame, CBody mCBody, string mTextureName, string mTilesetName = null,
                string mLabelName = null, float mRotation = 0)
 {
     _game        = mGame;
     _cBody       = mCBody;
     _textureName = mTextureName;
     _tilesetName = mTilesetName;
     _labelName   = mLabelName;
     _rotation    = mRotation;
 }
Ejemplo n.º 8
0
        public CShadower(SPGame mGame, CBody mCBody, bool mIsDrawn, Color mColor, int mMultiplier = 35)
        {
            _game = mGame;
            _cBody = mCBody;
            _isDrawn = mIsDrawn;
            _color = mColor;
            _vertexArrays = new List<Vertex[]>();
            ShadowCaster = new ShadowCaster(_cBody.Position, mMultiplier);

            if (_isDrawn) _game.AddDrawAction(Draw, -10);
        }
Ejemplo n.º 9
0
        public CShadower(SPGame mGame, CBody mCBody, bool mIsDrawn, Color mColor, int mMultiplier = 35)
        {
            _game         = mGame;
            _cBody        = mCBody;
            _isDrawn      = mIsDrawn;
            _color        = mColor;
            _vertexArrays = new List <Vertex[]>();
            ShadowCaster  = new ShadowCaster(_cBody.Position, mMultiplier);

            if (_isDrawn)
            {
                _game.AddDrawAction(Draw, -10);
            }
        }
Ejemplo n.º 10
0
        public CAI(SPGame mGame, CStats mCStats, CBody mCBody, CMovement mCMovement, CRender mCRender,
                   CLineOfSight mCLineOfSight)
        {
            _game         = mGame;
            _cStats       = mCStats;
            _cBody        = mCBody;
            _cLineOfSight = mCLineOfSight;
            _cMovement    = mCMovement;
            _cRender      = mCRender;

            WaitAmplitude              = _cStats.Speed.Total / 5f + 50;
            WaitDelayMax               = 450 - _cStats.Speed.Total / 5 + _cStats.Endurance.Total * 5f;
            BulletSpeedBase            = 150 + _cStats.Agility.Total * 8;
            BulletSpeedMax             = 400 + _cStats.Agility.Total * 10;
            BulletSpeedIncrease        = 25 + _cStats.Agility.Total * 3;
            WanderingDirectionDelayMax = 50 - _cStats.Speed.Total / 8f;
            WanderingSpeed             = _cStats.Speed.Total;
            ChaseSpeed    = _cStats.Speed.Total / 10f;
            ShootDelayMax = 40 - _cStats.Agility.Total / 8f;

            _bulletSpeed = BulletSpeedBase;

            mCBody.OnCollision += (mCollisionInfo) =>
            {
                var entity = (Entity)mCollisionInfo.UserData;
                if (entity.HasTag(Tags.Wall))
                {
                    if (_state == StateWandering && _turnAroundDelay <= 0)
                    {
                        _turnAroundDelay   = TurnAroundDelayMax;
                        _currentDirection += 90 * Utils.Random.NextSign();
                    }
                }

                if (entity.HasTag(Tags.BulletFriendly))
                {
                    _state = StateWait;
                    var vector = mCollisionInfo.Body.Position - mCollisionInfo.Body.Velocity * 5;
                    _currentDirection =
                        Utils.Math.Angles.TowardsDegrees(new SSVector2F(_cBody.X, _cBody.Y),
                                                         new SSVector2F(vector));
                }
            };
        }
Ejemplo n.º 11
0
        public CAI(SPGame mGame, CStats mCStats, CBody mCBody, CMovement mCMovement, CRender mCRender,
                   CLineOfSight mCLineOfSight)
        {
            _game = mGame;
            _cStats = mCStats;
            _cBody = mCBody;
            _cLineOfSight = mCLineOfSight;
            _cMovement = mCMovement;
            _cRender = mCRender;

            WaitAmplitude = _cStats.Speed.Total/5f + 50;
            WaitDelayMax = 450 - _cStats.Speed.Total/5 + _cStats.Endurance.Total*5f;
            BulletSpeedBase = 150 + _cStats.Agility.Total*8;
            BulletSpeedMax = 400 + _cStats.Agility.Total*10;
            BulletSpeedIncrease = 25 + _cStats.Agility.Total*3;
            WanderingDirectionDelayMax = 50 - _cStats.Speed.Total/8f;
            WanderingSpeed = _cStats.Speed.Total;
            ChaseSpeed = _cStats.Speed.Total/10f;
            ShootDelayMax = 40 - _cStats.Agility.Total/8f;

            _bulletSpeed = BulletSpeedBase;

            mCBody.OnCollision += (mCollisionInfo) =>
                                  {
                                      var entity = (Entity) mCollisionInfo.UserData;
                                      if (entity.HasTag(Tags.Wall))
                                      {
                                          if (_state == StateWandering && _turnAroundDelay <= 0)
                                          {
                                              _turnAroundDelay = TurnAroundDelayMax;
                                              _currentDirection += 90*Utils.Random.NextSign();
                                          }
                                      }

                                      if (entity.HasTag(Tags.BulletFriendly))
                                      {
                                          _state = StateWait;
                                          var vector = mCollisionInfo.Body.Position - mCollisionInfo.Body.Velocity*5;
                                          _currentDirection =
                                              Utils.Math.Angles.TowardsDegrees(new SSVector2F(_cBody.X, _cBody.Y),
                                                                               new SSVector2F(vector));
                                      }
                                  };
        }
Ejemplo n.º 12
0
 private CAI AI(CStats mCStats, CBody mCBody, CMovement mCMovement, CRender mCRender, CLineOfSight mCLineOfSight)
 {
     return new CAI(_game, mCStats, mCBody, mCMovement, mCRender, mCLineOfSight);
 }
Ejemplo n.º 13
0
 public CMovement(CBody mCBody)
 {
     _cBody = mCBody;
 }
Ejemplo n.º 14
0
 private CChild Child(Entity mParent, CBody mCBody)
 {
     return new CChild(mParent, mCBody);
 }
Ejemplo n.º 15
0
 private CControl Control(CBody mCBody, CStats mCStats, CMovement mCMovement, CRender mCRender)
 {
     return new CControl(_game, mCStats, mCBody, mCMovement, mCRender);
 }
Ejemplo n.º 16
0
 public CMovement(CBody mCBody)
 {
     _cBody = mCBody;
 }
Ejemplo n.º 17
0
 private CMovement Movement(CBody mCBody)
 {
     return new CMovement(mCBody);
 }
Ejemplo n.º 18
0
 private CRender Render(CBody mCBody, string mTextureName, string mTilesetName = null, string mLabelName = null,
                        float mRotation = 0)
 {
     return new CRender(_game, mCBody, mTextureName, mTilesetName, mLabelName, mRotation);
 }