コード例 #1
0
 /// <summary>
 /// オブジェクトを中に入れます
 /// </summary>
 protected void Input()
 {
     if (!this.IsIn)
     {
         double rad = new Vec(this.X - Game.WINDOW_R, this.Y - Game.WINDOW_R).Rad;
         this.Dot = Vec.FromRadLength(rad, Game.WINDOW_R - this.R);
         this.X  += Game.WINDOW_R;
         this.Y  += Game.WINDOW_R;
     }
 }
コード例 #2
0
        /// <summary>
        /// 移動処理
        /// </summary>
        /// <param name="key">キー</param>
        private void Move()
        {
            Direction d   = Player.getDirection();
            double    rad = 0;

            switch (d)
            {
            case Direction.UP_LEFT:
                rad = Radian.LEFT_UP;
                break;

            case Direction.UP_RIGHT:
                rad = Radian.RIGHT_UP;
                break;

            case Direction.UP:
                rad = Radian.UP;
                break;

            case Direction.DOWN_LEFT:
                rad = Radian.LEFT_DOWN;
                break;

            case Direction.DOWN_RIGHT:
                rad = Radian.RIGHT_DOWN;
                break;

            case Direction.DOWN:
                rad = Radian.DOWN;
                break;

            case Direction.LEFT:
                rad = Radian.LEFT;
                break;

            case Direction.RIGHT:
                rad = Radian.RIGHT;
                break;
            }

            if (d != Direction.NOTE)
            {
                Vec v = Vec.FromRadLength(this.ToMapRad(rad), this.speed);
                this.X += v.X;
                this.Y += v.Y;
            }
        }