예제 #1
0
        public Vector2 GetFootPosition()
        {
            Point2D cell = DrawHelper.Vector2ToEngineCell(mPosition);

            cell.Y++;
            return(DrawHelper.EngineCellToVector(cell));
        }
예제 #2
0
        public Point2D GetFootCell()
        {
            Point2D cell = DrawHelper.Vector2ToEngineCell(mPosition);

            cell.Y++;
            return(cell);
        }
예제 #3
0
        private void TryMove(EDirection MoveDir, TileMap TileMap)
        {
            Point2D newCell = DrawHelper.Vector2ToEngineCell(mPosition) + MoveDir.ToPoint2D();

            mCurrentDirection = MoveDir;
            if (EngineCore.InputHelper.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift) == true)
            {
                return;                 // no move, only Dir Change
            }
            if (CanMove(newCell, TileMap) == false)
            {
                return;
            }

            if (Character != null)
            {
                Character.Move(newCell);
            }
            mFinalPosition = DrawHelper.EngineCellToVector(newCell);
        }
예제 #4
0
        private Vector2 ClampToCell(Vector2 pos)
        {
            Point2D cellPoint = DrawHelper.Vector2ToEngineCell(pos);

            return(DrawHelper.EngineCellToVector(cellPoint));
        }