コード例 #1
0
        public Vector2 GetFootPosition()
        {
            Point2D cell = DrawHelper.Vector2ToEngineCell(mPosition);

            cell.Y++;
            return(DrawHelper.EngineCellToVector(cell));
        }
コード例 #2
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);
        }
コード例 #3
0
        private Vector2 ClampToCell(Vector2 pos)
        {
            Point2D cellPoint = DrawHelper.Vector2ToEngineCell(pos);

            return(DrawHelper.EngineCellToVector(cellPoint));
        }