示例#1
0
        public bool Move(Direction NewDirection, Map.Map Map)
        {
            this._status    = Status.Move;
            this._direction = NewDirection;

            switch (this.Direction)
            {
            case Direction.Top:
                this._y -= this.Speed;
                break;

            case Direction.Bottom:
                this._y += this.Speed;
                break;

            case Direction.Left:
                this._x -= this.Speed;
                break;

            case Direction.Right:
                this._x += this.Speed;
                break;

            case Direction.Non:
                break;

            default:
                break;
            }

            if (!Map.TransparanteCollision(this, Map.CollisionInList(this)))
            {
                return(true);
            }

            switch (this.Direction)
            {
            case Direction.Top:
                this._y += this.Speed;
                break;

            case Direction.Bottom:
                this._y -= this.Speed;
                break;

            case Direction.Left:
                this._x += this.Speed;
                break;

            case Direction.Right:
                this._x -= this.Speed;
                break;

            case Direction.Non:
                break;

            default:
                break;
            }

            return(false);
        }