I don’t understand the difference between function setup () and function draw ()
I read here on this forum → function setup ():
“This is where you get everything ready, load your pictures, etc. setup is like a
project manager, it gets things organised.”
“The draw function is the exciting one. Codea runs this 60 times per second,
and nothing gets on the screen unless draw puts it there. So this is really
important.”
Why can I place background(40,40,50) not under function setup()?
That’s not drawing, that’s loading… I think?
Setup runs first and only one time. This is a great place to setup variables and run any other code that you do not want being run 60 times a second.
Draw will run at best 60 times per second. It will redraw the screen each draw cycle. Placing a background here makes sure that the previous draw is erased and the new draw is drawn.
@AnnSophie why do you think backgroung() is loading? It is not loading anything, it is just drawing a uniform color big rectangle on the screen.
PS: welcome in Codea-land!