I'm new to game designing and have to create a game for my project but I keep coming across an error to do with:
index.html:93 Uncaught TypeError: Cannot read property 'innerHTML' of undefined
at drawMissiles (index.html:93)
at gameLoop (index.html:140)
Any idea how to fix this problem?
drawMissiles()
}
function drawMissiles() {
document.getElementsByTagName('missile')[0].innerHTML <--- (index.html:93)
for(var i = 0 ; i < missiles.length ; i++ ) {
document.getElementById('missile').innerHTML +=
`<div class='missile1' style='left:${missiles[i].left}px;
top:${missiles[i].top}px'></div>`;