Exemplo n.º 1
0
        public SymcolHitbox(Vector2 size, Shape shape = Shape.Circle)
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            Shape = shape;
            Size  = size;

            if (Shape == Shape.Circle)
            {
                Child = new SymcolContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    CornerRadius     = Width / 2
                }
            }
            ;
            else if (Shape == Shape.Rectangle)
            {
                Child = new SymcolContainer
                {
                    RelativeSizeAxes = Axes.Both
                }
            }
            ;
        }
Exemplo n.º 2
0
        protected DrawableTouhouSharpPlayer(P p, TouhouSharpPlayfield playfield)
            : base(p, playfield)
        {
            Add(THSharpInputHandler = new THSharpInputHandler());

            THSharpInputHandler.Pressed  = Pressed;
            THSharpInputHandler.Released = Released;

            Actions[THSharpAction.Up]    = false;
            Actions[THSharpAction.Down]  = false;
            Actions[THSharpAction.Left]  = false;
            Actions[THSharpAction.Right] = false;
            Actions[THSharpAction.Slow]  = false;
            Actions[THSharpAction.Shoot] = false;

            playfield.GameField.Add(Cursor = new SymcolContainer
            {
                Anchor       = Anchor.TopLeft,
                Origin       = Anchor.Centre,
                Size         = new Vector2(4),
                CornerRadius = 2,
                Alpha        = 0.2f,
                Masking      = true,

                Child = new Box
                {
                    RelativeSizeAxes = Axes.Both
                }
            });
        }