I’ve been trying out Codea for a while, using it as a platform to really explore my interest in programming. I have mixed results. While it is great to get something working, and I have pulled off direction detection and animation, it was not really by me. I ran into so many issues, that of which I posted to the community, and got sage help.

The problem is, I’m not sure if I am competent enough to be a programmer in the future, or even for Codea. Recently I’ve been playing with ellipses, but I realized if I wanted to do collision detection I would have to use physics and that confuses me to the core. (The physics example coming with Codea is kind of useless since it depends on other files, and I’m hopelessly confused.) Help? Advice? Anything? I don’t know what to do from here, whether to continue and try to improve in programming or do something better with my time.

@Treshure Don’t give up. The whole fun with using Codea is learning how to use it. You’re not going to know how to do everything at once, so just take what you know and keep adding something new to that. The physics engine is easier than it sounds. You just have to read thru the documentation, look for some simple examples and try to go from there. If you have problems then we’re here to explain what you don’t understand. If you can’t find simple examples that you understand, I’ll write some for you to learn by.

@treshure, it’s ok to get discouraged from time to time, just don’t dwell on it too long. Find simple things you can do. I have been programming as a hobby for over twenty years and I still haven’t explored the physics routines for the same reason you gave, it’s just too complicated. So I stick with my simple collision detection, if the distance is less than ten pixels from center, collide! Hang in there.

Never give up man, I’m pretty new to all of this, and all I can say is that it gets easier. At first everyone is lost, heck, I’ve been lost so many times that Ignatz and Andrew_stacey have more code in my game than I do (not really, but you get my point). And if you don’t like the popular way to do something, make your own way! Find a way you can understand and do that. As for elliptical collision detection, there IS a way to do it without physics, you just have to use some simple math like the Pythagorean theorem (and non-circular ellipses can also use the Pythagorean theorem, it’s just a wee bit trickier)

@Treshure - I agree with @dave1707 that everything looks harder than it is (except quaternions), and it may be worth persevering. I have written about physics in this ebook


and I show that most of the code in the Physics demo provided in Codea is unnecessary and confusing for simple examples (it put me off physics for months, when I started!), and you can do it much more simply. So maybe you could look at that.

I’d like to tackle the broader question you put, about learning programming in general. I think it really depends on why you’re doing this - whether it’s for fun, to learn about graphics programming, or as a potential career.

Codea is not for everyone, because it does require quite a lot of math, being graphical. I have been using it for a year, and although I have explored most of its features and written lots about them, it has been a real battle, and I am certainly not a competent graphics programmer. If I were younger and still deciding my career, it definitely wouldn’t be in this. I use Codea because I’ve always wanted to learn about graphics programming, and although it’s hard, I keep hitting my head on the wall. And I have had a lot of fun inbetween the confusion.

But if you’re just not having any fun, and you’ve given it all you can, and it’s not rewarding, then maybe it isn’t for you.

However, don’t take this as meaning you shouldn’t do any programming. Before this, I spent many years specialising in financial spreadsheet modelling & programming, and enjoyed it greatly. My value to business was also considerably higher with those skills.

I know @dave1707 also did a lot of other programming, and many other Codea users come here from other languages, and use them regularly in their work. And I know many of them, like me, struggle with some of the complex features in Codea.

So while it’s quite probable that you won’t become a full on graphics programmer, because very few people are good enough to do that, it should still be possible to develop your programming skills in other languages, and have fun and do useful things with them.

I would give physics another go, and maybe play with other features that aren’t so hard for you, and if it doesn’t work out, then try a different language and see how you go. But you’ve got this far, so don’t give up entirely!


@Treshure If you’re looking for an ellipse collision routine that doesn’t use physics, try this. Slide your finger around and across the ellipse. You can also use the parameter sliders to change the shape of the ellipse.

function setup()

function draw()
    background(40, 40, 50)
    xc=250    -- center of ellipse x axis
    yc=400    -- center of ellipse y axis
    ellipse(xc,yc,a*2,b*2)    -- draw ellipse
    x=CurrentTouch.x    -- touched x value
    y=CurrentTouch.y    -- touched y value
    -- check for collision
    if (x-xc)^2/a^2+(y-yc)^2/b^2 <= 1 then 

@Treshure - I also wrote several posts on how to create your own simple physics engine (NB if it wasn’t simple, I couldn’t do it), starting here


@Treshure Do not be discouraged if you use others code to learn. What I did, when first learning to use Codea, was to find all the code that would do what I wanted. I then spend hours working through it until I understood it. Then I’d try to do it on my own. If I failed I’d look back at others code. It’s persistence that will pay off. If you find coding fun then stick with it. If you dread coding then maybe it’s not for you.

@Treshure, I have been through a similar experience. My own project is very slowly coming together, and I have enjoyed solving problems and implementing new elements, but have been frustrated and discouraged many times.

I really want to finish and publish my app, and I am sure you want to do the same for yours. Keep your mind on the end goal, accept that you have things to learn and that others can and will help, and receiving that help doesn’t mean personal failure. No one is capable of figuring all this out on their own, everyone uses guides or reference materials to some degree.

Keep on going, before long you’ll have reached your goal and will be helping the new learners along their way.