Link Pixel Art
Hello everyone, can someone please explain to me what is the problem with the code. My mind is going bonkers now! Please help! Thx!
Voters
Hello everyone, can someone please explain to me what is the problem with the code. My mind is going bonkers now! Please help! Thx!
ok, so first of all you are using node.js, wich is a runtime envirenment for js so.. it does not have the window object or the canvas, to do the thing you want to do in your code you need first to create an html5 project (wich is what you need to create a canvas and draw on it)
then i see in your code that you are trying to use p5.js wich is a js lib so you need to link it to your project to bee able to use it.
here is the link!
put those before your script in the index.html file :)
and finally, your code still have some issues like in p5 the first thing you wanna do is create a canvas using the
createCanvas
function in setup, something likesorry i can't explain everything in one comment but if you want to learn it check the reference!
and if you didn't understand anything.. it's fine you just need to read the reference ;)
@potatojs Thx a lot! Well I don't usually use JS so I can say I am a newbie at it, hahahaha! Do you mind if I share that program with you so you can make the necessary changes so I can learn from it?
@Bitkoshy yeah np lol,
ok i'm gonna send you the new version with some comments explaining the stuff :)
but if you wanna learn js i may recommend the coding train p5 series wich is a great series to get started with js and p5!
@potatojs yup got it thx a lot!
@Bitkoshy hi can you explain what are you trying to do exactly in your code?
@potatojs I am just trying to run the code properly
@potatojs It should come out like this:

lol ok
@Bitkoshy
@potatojs hehehe thx.
wow ok i'm gonna try
@Bitkoshy
@potatojs thx thx thx! You can share me that repl.
yeeey https://repl.it/@potatojs/p5-gg#script.js
for some reason it's not excatly how you want it lol
@Bitkoshy
lol
@Bitkoshy
yey i got it
https://repl.it/@potatojs/p5-gg#script.js
}@Bitkoshy
@potatojs Not bad for a start. But since I am new were did the colour all go?
@Bitkoshy i fix it i fix it lol https://repl.it/@potatojs/p5-gg#script.js
@potatojs lmao!!!
@potatojs so exciting!
lol
@Bitkoshy
@potatojs thx solved it!
wow thx i got an achivement :D
@Bitkoshy
@potatojs Hehehe you DESERVED IT!!!!
thank you! :D
@Bitkoshy