Exemplo n.º 1
0
        public PlayerBrain(GameObject owner) : base(owner)
        {
            _movingBody   = owner.Components.Get <MovingBody>();
            _transform    = owner.Components.Get <TransformComponent>();
            _spriteRender = owner.Components.Get <SpriteRenderComponent>();
            _halfSize     = _spriteRender.Sprite.Bounds.Size / 2;

            _boundingBox              = owner.Components.Get <BoundingBoxComponent>();
            _boundingBox.OnCollision += (sender, collidedWith) =>
            {
                this.Owner.Enabled = false;
            };
        }
Exemplo n.º 2
0
 public BulletBrain(GameObject owner) : base(owner)
 {
     _movingBody         = owner.Components.Get <MovingBody>();
     _transformComponent = owner.Components.Get <TransformComponent>();
 }