Ask coding questions

← Back to all posts
Is my code correct or is the editor just faulty?
tazer900 (0)

Hey, I'm new to javascript and I bought a book called "Coderdojo <nano> Make your Own Game! create with <code>" to learn some Javascript. In one of my lines, it says c.drawImage(image, x, y);

I press run and I got an error saying something about that line and a function I made. Plus, I don't know how to fix it. Can someone help me??

Answered by OmN3xin (51) [earned 5 cycles]
View Answer
OmN3xin (51)

You did not specify the exact path that the image is in. The image is in

Art Assets/nanonaut.png

you wrote that it was in


So just change 'nanonaut.png' into 'Art Assets/nanonaut.png'
Have a good day/night :)

tazer900 (0)

@OmN3xin Thx you! It works now :)

tussiez (1515)

@tazer900 Make sure to hit the checkmark next to OmN3xin's comment to mark it as the correct answer :D