1st May 2022, 5:21 PM
Spencer Pawlik
Spencer Pawlik - avatar
6 Réponses
+ 4
"%" means that it is a string, compare "%" vs. %
1st May 2022, 5:35 PM
Lisa
Lisa - avatar
+ 1
Did you mean "%"?
1st May 2022, 5:27 PM
Lisa
Lisa - avatar
+ 1
And I think your call to monster() needs to be inside of the onload function
1st May 2022, 5:29 PM
Lisa
Lisa - avatar
0
Yeah
1st May 2022, 5:28 PM
Spencer Pawlik
Spencer Pawlik - avatar
0
Didn't change.
1st May 2022, 5:31 PM
Spencer Pawlik
Spencer Pawlik - avatar
0
window.onload = () => { document.getElementById("shootb").addEventListener("click", shoot) monster(); }; and add functions are outside onload also document.getElementById("monster"+num).style.top= ran+"%"; // use as string. edit: looks like just last change is enough...🙁 strange SL ..
1st May 2022, 5:32 PM
Jayakrishna 🇮🇳