We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5657282 commit 6fc6eeaCopy full SHA for 6fc6eea
1 file changed
heartmeter/index.js
@@ -10,7 +10,7 @@ const canvas = document.getElementById("canvas");
10
const ctx = canvas.getContext("2d");
11
12
const heartImg = new Image();
13
-heartImg.src = "/heartmeter/heart.png";
+heartImg.src = "heart.png";
14
heartImg.onload = render;
15
16
const healSound = new Audio("increment_health.ogg");
@@ -199,6 +199,8 @@ function updateScale() {
199
document.getElementById("display").innerText = scale;
200
}
201
202
-updateScale();
203
-render();
204
-requestAnimationFrame(animate);
+window.onload = () => {
+ updateScale();
+ render();
205
+ requestAnimationFrame(animate);
206
+}
0 commit comments