Skip to content

Commit 8141be5

Browse files
Draw Apples (Red Color) in Minimaps
1 parent e90355e commit 8141be5

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

public/home.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const COLORS = {
55
blooming: '#36856B',
66
withering: '#7C5F4C',
77
sign: '#B0866A',
8+
apple: '#FE5457',
89
};
910

1011
// Load apple image for letter O
@@ -452,10 +453,12 @@ function drawMinimap() {
452453
const { bounds, tiles } = plant;
453454

454455
for (const tile of tiles) {
455-
const { x, y, isSeed, blooming } = tile;
456+
const { x, y, letter, isSeed, blooming } = tile;
456457

457458
if (isSeed) {
458459
minimapCtx.fillStyle = COLORS.seed;
460+
} else if (letter && letter.toUpperCase() === 'O') {
461+
minimapCtx.fillStyle = COLORS.apple;
459462
} else if (blooming) {
460463
minimapCtx.fillStyle = COLORS.blooming;
461464
} else {

public/plant.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ const COLORS = {
321321
background: '#FFFFFF',
322322
secondary: '#EBEBEB',
323323
seed: "#124434",
324+
apple: "#FE5457",
324325

325326
blooming: {
326327
primary: '#36856B',
@@ -1510,10 +1511,12 @@ function drawMinimap() {
15101511
ctx.strokeRect(MINIMAP_PADDING - 1.5, MINIMAP_PADDING - 1.5, MINIMAP_WIDTH + 3, MINIMAP_HEIGHT + 3);
15111512

15121513
for (const cell of grid.values()) {
1513-
const { x, y, isSeed, blooming } = cell;
1514+
const { x, y, letter, isSeed, blooming } = cell;
15141515

15151516
if (isSeed) {
15161517
ctx.fillStyle = COLORS.seed;
1518+
} else if (letter && letter.toUpperCase() === 'O') {
1519+
ctx.fillStyle = COLORS.apple;
15171520
} else if (blooming) {
15181521
ctx.fillStyle = COLORS.blooming.primary;
15191522
} else {

0 commit comments

Comments
 (0)