I’m just getting into Codea with my twin 9 year old boys. I’m searching for one good project for them to get started with, in tutorial form. I’m thinking a spaceship that flies and shoots baddies out of the sky or something simple like that. We did the For Kids tutorial, and it went well, and we’re looking for the next step.
I see there are tons of documents and videos out there, but I haven’t found anything that feels right yet. I ask the community here - can you suggest something for me?
I’m a programmer myself, and work for a kids education company called Speakaboos. Thanks in advance for any advice you have to share!
@interactivenyc - hi. Great as Codea is, I don’t think it’s for such young kids, because although it’s the easiest way to program iOS graphics, it’s still a programming language, and they need to learn Lua before they can really use Codea, which it may be too difficult for young children - unless they are very keen. We have had 11 year olds successfully learning Codea, but I think they are the exception rather than the rule.
I don’t know how keen your kids are, but I would probably suggest starting with more of a drag and drop app, eg an RPG builder, to get the hang of programming flow, and then introduce them to to full on programming later.
There are a number of step by step projects in the wiki, here
Unfortunately, I fear you’re not going to find anything terribly organised to help you, because Codea was built by a small team, and the user group, although enthusiastic and friendly, is also fairly small.
If you want to try it anyway, I suggest you pre-build simple projects, then get them to replicate what you have done. Simple 2D moving objects can be programmed pretty easily, and the physics engine will add collisions and bounces for you.
Anyway, don’t let me put you off. You’re in the best position to judge what will work best.
Thanks for your thoughtful comments! My kids are pretty sharp, but I agree with you that many of the concepts are pretty hard for them. However, we’re going to keep plugging away for a while to see if we can learn even a little coding
I’m happy to report back with my results. Perhaps I’ll make a tutorial of my own to share with others.
I’m thinking, right now I want to create a joystick to control a character on the screen. I’ll draw an ellipse on touched, and determine in the touch state if the finger is to the left or the right of the original touch point to control left and right movement. Wish me luck!
That’s cool. Is there a way I can see that code in action? Can I open a sample program with your joystick in it?
I’ve gotten a start on mine - right now, it’s just left/right motion, but the circle will position itself anywhere you begin an initial tap. I like the circle inside a circle you’ve got to determine a vector for movement. Me want 2 borrow!
I’m having trouble trying to make a variable in my JoystickLeft class a class variable, rather than a global variable by calling it self.visible. I’m getting an error when trying to do this. Can somebody tell me what I’m doing wrong?
Now I have a joystick with a dot in the center that represents the direction my CharacterSprite is supposed to be moving.
I’ve got functions moveLeft and moveRight inside CharacterSprite, which is a global variable called “character” in my Main class. Inside my JoystickLeft class I’m trying to call character.moveLeft with no luck. I think I need some basic help here with syntax and how classes call each other’s methods.
Anyone willing to look and give me some guidance, and I’ll keep publishing my code so others can use it? Is this a good way to collaborate, or is there a better way to share entire Codea projects?
Sorry I forgot to click paste here is the joystick @interactivenyc
displayMode(FULLSCREEN)
function setup()
rectMode(CENTER)
s1,s2=nil,nil
end
function draw()
background(40, 40, 50)
fill(255)
line(0,HEIGHT/2,1000,HEIGHT/2)
strokeWidth(5)
noFill()
ellipse(100,100,100)
ellipse(665,915,100)
if s1 then
s1:draw()
end
if s2 then
s2:draw()
end
end
function touched(t)
if t.state==BEGAN then
if s1==nil and t.y > 50 and t.y < 150 and t.x > 50 and t.x < 150 then
s1=stick(100,100,t.id)
elseif s2==nil and t.y > 875 and t.y < 965 and t.x > 615 and t.x < 715 then
s2=stick(665,915,t.id)
end
end
if t.state==MOVING then
if s1~=nil and t.id==s1.id and t.y < HEIGHT/2 then
s1:touched(t)
end
if s2~=nil and t.id==s2.id and t.y > HEIGHT/2 then
s2:touched(t)
end
end
if t.state==ENDED then
if s1~=nil and s1.id==t.id then
s1=nil
end
if s2~=nil and s2.id==t.id then
s2=nil
end
end
end
stick=class()
function stick:init(x,y,id)
self.x=x
self.y=y
self.ox=x
self.oy=y
self.id=id
end
function stick:draw()
fill(255, 255, 255, 255)
noStroke()
ellipse(self.ox,self.oy,10)
ellipse(self.x,self.y,10)
stroke(255)
strokeWidth(2)
line(self.x,self.y,self.ox,self.oy)
if self.y>HEIGHT/2 then
rect(self.x,HEIGHT-150,100,30)
else
rect(self.x,150,100,30)
end
end
function stick:touched(t)
self.x=t.x
self.y=t.y
end