Beispiel #1
0
        public virtual void Init(Constants.Side side, Wall wall)
        {
            this.Side = side;
            this.Wall = wall;

            Label livesLabel = Services.LabelsService.GetLivesLabelNode(side);

            this.LivesLabel = livesLabel;
            CallDeferred("add_child", LivesLabel);

            Paddle paddle = Services.PaddleService.GetNodePaddle(side);

            this.Paddle = paddle;
            CallDeferred("add_child", Paddle);

            this.UpdateLivesLabel();
        }
Beispiel #2
0
        public static string GetWallNameBySide(Constants.Side side)
        {
            switch (side)
            {
            case Constants.Side.TOP:
                return(Constants.WallName.Top);

            case Constants.Side.RIGHT:
                return(Constants.WallName.Right);

            case Constants.Side.BOTTOM:
                return(Constants.WallName.Bottom);

            case Constants.Side.LEFT:
                return(Constants.WallName.Left);

            default:
                throw new ArgumentException("Parameter has no equivalent of WallName");
            }
        }
Beispiel #3
0
        public static Vector2 GetLivesLabelPositionBySide(Constants.Side side)
        {
            {
                switch (side)
                {
                case Constants.Side.TOP:
                    return(Constants.Labels.Position.Top);

                case Constants.Side.RIGHT:
                    return(Constants.Labels.Position.Right);

                case Constants.Side.BOTTOM:
                    return(Constants.Labels.Position.Bottom);

                case Constants.Side.LEFT:
                    return(Constants.Labels.Position.Left);

                default:
                    throw new ArgumentException("Parameter has no equivalent of Label position");
                }
            }
        }