- pixelX = (float)(gridX * Map.PixelsToUnitSquares);\r
- pixelY = (float)(gridY * Map.PixelsToUnitSquares);\r
- state = State.up;\r
- gridY -= 1;\r
- movementCoolDown = moveCoolDown;\r
- isMoving = true;\r
- changeY = (float)(-Map.PixelsToUnitSquares / moveCoolDown);\r
- }\r
- // move down\r
- else if (keysPressed.Contains<Keys>(Keys.Down) && theMap.IsCellOpen(gridX, gridY + 1))\r
- {\r
- pixelX = (float)(gridX * Map.PixelsToUnitSquares);\r
- pixelY = (float)(gridY * Map.PixelsToUnitSquares);\r
- state = State.down;\r
- gridY += 1;\r
- movementCoolDown = moveCoolDown;\r
- isMoving = true;\r
- changeY = (float)(Map.PixelsToUnitSquares / moveCoolDown);\r
- }\r
- // move left\r
- else if (keysPressed.Contains<Keys>(Keys.Left) && theMap.IsCellOpen(gridX - 1, gridY))\r
- {\r
- pixelX = (float)(gridX * Map.PixelsToUnitSquares);\r
- pixelY = (float)(gridY * Map.PixelsToUnitSquares);\r
- state = State.left;\r
- gridX -= 1;\r
- movementCoolDown = moveCoolDown;\r
- isMoving = true;\r
- changeX = (float)(-Map.PixelsToUnitSquares / moveCoolDown);\r
- }\r
- // move right\r
- else if (keysPressed.Contains<Keys>(Keys.Right) && theMap.IsCellOpen(gridX + 1, gridY))\r
- {\r
- pixelX = (float)(gridX * Map.PixelsToUnitSquares);\r
- pixelY = (float)(gridY * Map.PixelsToUnitSquares);\r
- state = State.right;\r
- gridX += 1;\r
- movementCoolDown = moveCoolDown;\r
- isMoving = true;\r
- changeX = (float)(Map.PixelsToUnitSquares / moveCoolDown);\r