New to Programming and Codea

I don’t think they are all listed in the reference section, as many times I have read through it, but what are all of the setup functions
and draw functions in Codea and how do you use them? I know how to use only a few from the practice I have done in Codea tutorials.
I would please like to get your input and guidence.

@strotherdw Here’s one thing you can do. On the right side of the forum page under “Start a New Discussion”, are Categories. Under there select “Code Sharing”. That will list discussion titles that I’m sure will have plenty of example code that you can look at. Find small examples, run them, and try changing code just to see what happens. Also, you’ll see plenty of code in the setup and draw functions that you can then lookup in the built in manual.

I will try it and see what happens. Thanks. If you or anyone else have any more advice or tips feel free to share them with me.

Look in the Wiki link at the top. There are lots of tutorials and a couple of ebooks.

I suggest you start by learning some Lua (the language behind Codea).

@strotherdw If you have any questions about what you see or don’t understand, don’t hesitate to ask. It’s easier to respond to a direct question when you show some code and ask “why does this happen” or “how can I make this do what I want” instead of asking for general information.

Unfortunately for me easier said than done. I can’t learn Lua to save my life right now Ignatz. Every time I read the Lua Manual or even if I read a tutorial about Lua I can’t understand past the first three pages. I’m still confounded. What do I do?

You see I figured if I knew all the functions I could begin to put things together to get a better grasp of how Codea works and a least get past the beginner level to make intermediate level code.

If you don’t know how to set variables, or write if statements and loops, then you can’t write Codea programs. A little Lua is essential. The Lua manual is not the best place to start.

Have you tried the ebook I wrote for beginners?

https://www.dropbox.com/s/qh1e7ft4rvhlpt2/Lua%20for%20beginners.pdf

@strotherdw Learning all the functions isn’t going to help, because you’re not going to use all the functions. The way to start is small. I’m not sure how much programming you know, but it sounds like not much. Here is a small program that shows the 3 functions that Codea mainly uses. It moves a sprite around the screen to follow your finger. Look at the on line manual and understand what each line does. Add more sprites, more ellipses, change the color. Once you understand what’s happening, add more code to make it do something different. You can’t write a large program until you understand a small program. Look thru the online manual for simple things and try adding those. Don’t be afraid to try things, you can’t break anything. If something doesn’t work, try to understand why. You’ll learn more from what doesn’t work than from what does.


displayMode(FULLSCREEN)

function setup()
    x=0    -- set x,y to 0
    y=0
end

function draw()
    background(40, 40, 50)    -- set screen background color
    fill(219, 40, 40, 255)    -- set color for ellipse
    ellipse(WIDTH/2,HEIGHT/2,30)    -- draw ellipse at center of screen
    sprite("Planet Cute:Character Pink Girl",x,y)    -- draw sprite at x,y
end

function touched(t)
    x=t.x    -- set x to touched x value
    y=t.y    -- set y to touched y value
end
    

Yes I have read Lua for beginners, but Ignatz I could not even understand that? I don’t know why? Maybe it’s because I have always had trouble in math more than every one else in school. I decided to get into learning this because I did not want to let my weakness in math hold me back from doing one of the things I love to do, making games and graphics on the computer. I love to create period. Which is why I still have not given up learning this.

You may be right Dave1707 that learning all the functions will not help, but the reason I made such a question is I wanted to put things in general categories and then break things down into more specific sub categories, so I could if possibly have a more predictable guideline to go by. When it comes to learning, I’m a guy who likes order and hates chaos, although in some situations chaos may be beneficial, but I find those situations to be very few.

@Dave1707 I like the phrase you guys use “you can’t break anything.” It is one of the most reassuring phrases and helps me to relax.

@strotherdw Not at all! It’s an issue with one of the forum plugins that isn’t working correctly. Completely server-side, nothing but irritation client-side.

The forum bug is will not harm my Ipad will it?

@strotherdw There’s a strange Forum bug that causes that, but the posts do post. I’ve deleted the duplicates to clean up.

Take it slow, read everything you can find, gradually it starts to fell into place. We all started out feeling stupid…

Sorry for the bizarre repeating message but for some weird reason when I tried to correct the message the forum said error and kept posting it.

That’s good to know, so does that mean when I click on any item in the forum I am protected from viruses, worms, and malware, or do I still have to watch out even on the forums?

@strotherdw You should still take the usual precautions you do for any website.

As far as I’m aware, I don’t have worms, but I can’t speak for the others :smiley: