I just spent 2 hours in the car with Codea to find a lot of bugs and crashes. Here are some of them:
- It seems that the user acceleration x and y are reversed. It’s in the right orientation, but you can check that out.
- Some help file don’t wrap the text (like physics.iterations) and none wrap code, so please allow scrolling to the side.
- For some reason, I stacked about 20 boxes right on top of each other, and even when they are placed exactly on top of each other and when dropped, they fall. The gravity is the default one and each body has the same characteristics. And it’s not random because they always end up the same way when they stop moving.
- Crash with this code:
function setup() --displayMode(FULLSCREEN) frogLive = frog() frogDead = deadFrog() pfrogx = 100 pfrogy = 100 frogx = 100 frogy = 100 frogw, frogh = spriteSize(frogLive) froglives = 0 frogBody = physics.body(CIRCLE,frogw) end -- This function gets called once every frame function draw() clearOutput() background(0, 0, 0, 255) strokeWidth(0) fill(173, 173, 173, 255) stroke(255, 251, 0, 255) lineCapMode(SQUARE) -- Do your drawing here drawRoad() drawFrog() end function drawFrog() --scale(2) sprite(frogDead,frogx,frogy) pfrogx = frogx pfrogy = frogy frogx = frogx + Gravity.x*10 frogy = frogy + Gravity.y*10 if frogx >= WIDTH or frogx <= 0 then frogx = pfrogx end if frogy >= HEIGHT or frogy <= 0 then frogy = pfrogy end end function drawRoad() rect(0,HEIGHT - HEIGHT/7*6,WIDTH,HEIGHT/7*5) drawLines() end function drawLines() strokeWidth(8) for i = 0, WIDTH/50 do sline = i * 50 line(sline, CurrentTouch.y,sline+25,CurrentTouch.y) end strokeWidth(0) end
It’s this that crashes it:
frogw, frogh = spriteSize(frogLive). Help? I’d give you the crash log, but it’s too long.
As you can see, I’m coding Frogger.
5. “y” is listed twice under mesh.addRect() and there is duplicate text in some other files.
6. There were a few other bugs I’ll identify and list later.
But with all this time, I came to love Codea even more (if that’s even possible).