コード例 #1
0
            public TubeStateInitialize(Tube owner)
                : base(owner)
            {
                _scale = 0f;
                _rate  = 0.05f;
                //_origin = new Vector2(Owner.Width / (float)2, Owner.Height / (float)2);
                _origin   = new Vector2(20, 20);
                _position = new Vector2(Owner.X + Owner.Width / 2, Owner.Y + Owner.Height / 2);

                Owner.InternalInputs = TubeInputsHelper.Tubes[Random.Next(0, TubeInputsHelper.Tubes.Length)];
            }
コード例 #2
0
            public TubeStateFade(Tube owner)
                : base(owner)
            {
                _alpha = 1.0f;
                _rate  = 0.02f;

                _destination = new Rectangle
                               (
                    Owner.X,
                    Owner.Y,
                    Owner.Width,
                    Owner.Height
                               );
            }
コード例 #3
0
            public TubeStateRotate(Tube owner, RotationDirection direction)
                : base(owner)
            {
                _direction = direction;

                _rotation = 0;

                _rotationRate =
                    direction == RotationDirection.Clockwise
                        ? MathHelper.ToRadians(15)
                        : MathHelper.ToRadians(-15);

                _destination = new Rectangle
                               (
                    Owner.X + Owner.Width / 2,
                    Owner.Y + Owner.Height / 2,
                    Owner.Width,
                    Owner.Height
                               );

                _origin = new Vector2(Owner.GetSourceRectangle().Width / (float)2, Owner.GetSourceRectangle().Height / (float)2);
            }
コード例 #4
0
 protected TubeState(Tube owner)
 {
     Owner = owner;
 }
コード例 #5
0
 public TubeStateNormal(Tube owner)
     : base(owner)
 {
     _destination = new Rectangle(Owner.X, Owner.Y, Owner.Width, Owner.Height);
 }