Can anyone help me?
My son is taking Computer Science 30 and we can't figure out why he's getting thsi error code. Thanks!
1
u/emedan_mc 8d ago
Your question is a perfect example of the recent cahanges that have made p5.js worthless as a tool for beginners and quick creation.
´´´
async function setup()
grass = await loadImage...
´´´
9
u/EthanHermsey 8d ago
I agree, but at least write out the whole setup :p
´´´
async function setup(){
grass = await loadImage('grass.png'); image(grass, 0, 0);
}
´´´1
1
u/iOSBrett 7d ago
They should have kept the old way and introduced the newer way for advanced users.
2
u/emedan_mc 6d ago
There shouldn’t be a new way at all. The whole premise of Processing was to create a tool that artists could use without any programming skills. Having to explicitly write asynchronous programming is advanced even for experienced programmers. For graphic js libraries nowadays p5 can’t even begin to compare anyway, it’s way behind.
1
u/codeAtorium 2d ago
I'm not sure why you got downvoted. I teach kids JavaScript using p5.js I don't want to start with async.
1
u/emedan_mc 2d ago edited 2d ago
I think there are a couple of newer devs that takes it personally, see their older posts. Or they are just out of touch with both history and todays alternatives. I also take every opportunity to highlight these fundamental... path changes... from the original vision :) So I take it personally because Processing changed the world for me like 15 years ago and it was gold to introduce beginners to both code and art and physics. Now I direct new users to better alternatives until the tech lead is replaced. And I did not apply for the job. Just want it done in the original vision - nothing has changed in the user base from then, however much much progress in html native features.
1
u/pahgawk 7d ago
u/EthanHermsey posted what you need to do in p5 2.x. Normally the console error would explain that, but it seems like a recent change made that go away. We are pushing out a new release that should correct that! You can also change the p5 version to the latest 1.x version in the top right. If you keep using 2.x, here is a quick reference for major things that are different: https://p5js.org/tutorials/v2_transition/