Beispiel #1
0
 public virtual void animation(chara_picturBOX pic)
 {
     //右端かどうか
     if (_xy.X + _size.Width > pic.Width)
     {
         //右端の場合
         _vec.dx = -(_vec.dx);
     }
     //左端かどうか
     if (_xy.X < 0)
     {
         //左端の場合
         _vec.dx = -(_vec.dx);
     }
     //下端かどうか
     if (_xy.Y + _size.Height > pic.Height)
     {
         //下端の場合
         _vec.dy = -(_vec.dy);
     }
     //上端かどうか
     if (_xy.Y < 0)
     {
         //上端の場合
         _vec.dy = -(_vec.dy);
     }
 }
Beispiel #2
0
        //ボールの速さを変えるためにanimationをオーバーライドしている
        public override void animation(chara_picturBOX pic)
        {
            _animationcount++;
            _xy.X = _xy.X + _vec.dx + _vec.dx * _animationcount / 150;
            _xy.Y = _xy.Y + _vec.dy + _vec.dy * _animationcount / 150;

            //最後に元のやつを動かさないとボールが出てく
            base.animation(pic);
        }