Skip to content

Commit 6fc6eea

Browse files
committed
Proper fix?
1 parent 5657282 commit 6fc6eea

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

heartmeter/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const canvas = document.getElementById("canvas");
1010
const ctx = canvas.getContext("2d");
1111

1212
const heartImg = new Image();
13-
heartImg.src = "/heartmeter/heart.png";
13+
heartImg.src = "heart.png";
1414
heartImg.onload = render;
1515

1616
const healSound = new Audio("increment_health.ogg");
@@ -199,6 +199,8 @@ function updateScale() {
199199
document.getElementById("display").innerText = scale;
200200
}
201201

202-
updateScale();
203-
render();
204-
requestAnimationFrame(animate);
202+
window.onload = () => {
203+
updateScale();
204+
render();
205+
requestAnimationFrame(animate);
206+
}

0 commit comments

Comments
 (0)