Ask coding questions

← Back to all posts
Shooting not working JavaScript
h
p1ckl3

I asked a question similar to this a while ago with the same game about shooting. @sixbeeps replied with an awesome answer that worked. But after time, the code started not to work(probably because I accidentally moved some stuff around). Anyone know what looks wrong with the shooting code?

Edit: I just noticed that the document.title is not even working. So maybe the whole code is just not running.

Answered by ch1ck3n [earned 5 cycles]
View Answer
Voters
p1ckl3
Comments
hotnewtop
ch1ck3n

look closely at line 176 in index.html

p1ckl3

Thanks @ch1ck3n! I love your work

ch1ck3n

@okalisl thanks

mark as correct?

SixBeeps

Line 105 of your code, you forgot to close the ( for pos.

p1ckl3

Oh @SixBeeps. Wait, so that is the only thing wrong??

p1ckl3

Wait -- It seems like the issue is that when the program is run, it deletes itself. Thats so wierd

ch1ck3n

@okalisl btw you're still missing a comma

SixBeeps

@okalisl index.html is automatically generated from main.js when you hit run. Therefore, you can't touch anything in index.html.