Exemplo n.º 1
0
        public TestBullet(IProjectileLogic p) : base(p)
        {
            if (_texture == null)
            {
                _texture = new Texture("Resources/Bullet.png");
            }

            var image = new Image(_texture);

            var collider = new PolygonCollider(_basePolygon, CollidableTags.Bullet);

            Utilities.RotatePolygon(Projectile.DegOrientation + 90, collider, _basePolygon);
            Projectile.AddCollider(collider);

            Projectile.AddGraphic(image);
            image.Angle = Projectile.DegOrientation + 90;

            _direction = new Vector2(16 * ((float)Math.Sin(Projectile.DegOrientation * Util.DEG_TO_RAD)),
                                     16 * ((float)Math.Cos(Projectile.DegOrientation * Util.DEG_TO_RAD)));
        }