Skip to content

Commit

Permalink
Run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 16, 2024
1 parent 69f5df7 commit b625fab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/styles/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
}

#minimap-name {
color: #FFF;
color: #fff;
text-transform: capitalize;
font-size: 1rem;
}
Expand Down
19 changes: 10 additions & 9 deletions src/utils/miniMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export const drawMinimap = (k, player) => {
mapImage.src = map.png;

// Draw the map title
const mapName = document.getElementById("minimap-name")
mapName.innerHTML = miniMapVisible ? map.name : "";
const mapName = document.getElementById('minimap-name');
mapName.innerHTML = miniMapVisible ? map.name : '';

// Clear previous frame
minimapCtx.clearRect(0, 0, minimapCanvas.width, minimapCanvas.height);
Expand All @@ -43,20 +43,22 @@ export const drawMinimap = (k, player) => {
const playerMinimapX = player.pos.x * xScale; // Scale player X position
const playerMinimapY = player.pos.y * yScale; // Scale player Y position


// Once the sprite is loaded, extract the specific frame for the player's current animation
const spriteSheet = new Image();
spriteSheet.src = './assets/sprites/characters.png'; // Load the sprite sheet

// Draw the specific frame on the minimap
minimapCtx.drawImage(
spriteSheet,
0, 32, // Source X and Y position on the sprite sheet
16, 16, // Source width and height
playerMinimapX, playerMinimapY - 10, // Destination X and Y on the minimap canvas
16, 16 // size on mini-map
0,
32, // Source X and Y position on the sprite sheet
16,
16, // Source width and height
playerMinimapX,
playerMinimapY - 10, // Destination X and Y on the minimap canvas
16,
16 // size on mini-map
);

};

// Function to toggle the minimap
Expand All @@ -67,5 +69,4 @@ export const toggleMinimap = (k) => {
const miniMapVisible = minimapCanvas.style.display === 'block';
// Set minimap on/off depending on current status
minimapCanvas.style.display = miniMapVisible ? 'none' : 'block';

};

0 comments on commit b625fab

Please sign in to comment.