コード例 #1
0
 protected DrawableProjectile(P p)
 {
     Projectile = p;
     Add(Hitbox = new SymcolHitbox(p.Size, p.Shape)
     {
         Team = p.Team
     });
 }
コード例 #2
0
ファイル: DrawableCharacter.cs プロジェクト: Xoas/TouhouSharp
        protected DrawableCharacter(C c, GamemodePlayfield playfield)
        {
            Character         = c;
            GamemodePlayfield = playfield;

            Size       = c.Size;
            Add(Hitbox = new SymcolHitbox(new Vector2((float)c.HitboxWidth)));
        }
コード例 #3
0
ファイル: Character.cs プロジェクト: miterosan/TouhouSharp
        private void load(THSharpSkinElement textures)
        {
            Health = MaxHealth;

            Anchor = Anchor.TopLeft;
            Origin = Anchor.Centre;

            //TODO: Temp?
            Size = new Vector2(64);

            AddRange(new Drawable[]
            {
                Seal          = new Seal(this),
                SoulContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    Colour           = PrimaryColor,
                    Alpha            = 1,
                    Children         = new Drawable[]
                    {
                        StillSprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Alpha            = 1,
                        },
                        RightSprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Alpha            = 0,
                        },
                        LeftSprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Alpha            = 0,
                        },
                    }
                },
                KiaiContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    Alpha            = 0,
                    Children         = new Drawable[]
                    {
                        KiaiStillSprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Alpha            = 1,
                        },
                        KiaiRightSprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Alpha            = 0,
                        },
                        KiaiLeftSprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Alpha            = 0,
                        },
                    }
                },
                VisibleHitbox = new CircularContainer
                {
                    Anchor          = Anchor.Centre,
                    Origin          = Anchor.Centre,
                    Alpha           = 0,
                    Size            = new Vector2(HitboxWidth + HitboxWidth / 4),
                    BorderColour    = PrimaryColor,
                    BorderThickness = HitboxWidth / 4,
                    Masking         = true,

                    Child = new Box
                    {
                        RelativeSizeAxes = Axes.Both
                    },
                    EdgeEffect = new EdgeEffectParameters
                    {
                        Radius = HitboxWidth / 2,
                        Type   = EdgeEffectType.Shadow,
                        Colour = PrimaryColor.Opacity(0.5f)
                    }
                }
            });

            Add(Hitbox = new SymcolHitbox(new Vector2(HitboxWidth))
            {
                Team = Team
            });

            if (CharacterName == "player" || CharacterName == "enemy")
            {
                KiaiContainer.Colour = PrimaryColor;
            }

            LoadAnimationSprites(textures);
        }