Ask coding questions

← Back to all posts
Image Not Defined
GeneralBaker

Run the code, and the error says it all.

Voters
GeneralBaker
Comments
hotnewtop
Coder100

Silly, you forgot to append this to it!

for game.js line 19. Also we use push around here, append is for java

GeneralBaker

Thanks for the help with this, but if you scroll to the bottom of the page I have the error I was having trouble with... @Coder100

GeneralBaker

Also I wrote this practically blind, as repl.it was down today and I had no way to test any of this until recently. So if you keep getting bugs, that's why. ;)@GeneralBaker

Coder100

any luck? @GeneralBaker

GeneralBaker

0 errors now, but when it still doesn't work, that is almost scarier. It is supposed to 'print' out the level, but if you run it, it still prints nothing. If you help fix it I will mark this as the answer. @Coder100

Coder100

wait why did you add a this to draw on line 39 in game.js? That's not valid btw

Coder100

coder100 on it

GeneralBaker

I fixed the bug, but I am still curious what the error is. @Coder100

Coder100

imageAir? idk @GeneralBaker

Coder100

the general rule for me is if i don't see it, it got fixed @GeneralBaker

GeneralBaker

Here is the error again:

ReferenceError: imageAir is not defined
[email protected]/src/block.js:18:5
buildLevel/</<@/src/level.js:24:23
buildLevel/<@/src/level.js:15:9
[email protected]/src/level.js:13:9
[email protected]/src/game.js:18:28
[email protected]/script.js:9:14
@/script.js:6:1

GeneralBaker

Yeah but what about this error? Check in the 'block.js' file. I changed some stuff to fix this, but for some reason it isn't letting me set a variable to a previously found image. @Coder100