real beginner question

Okay, now I've got a simple game app. It runs through once and you get a score and then it ends. How do I start it again at the beginning so I can save and add to the score? I remember when I was 10 I once programmed something in basic, and you could goto a specific line. I looked but didn't see anything like that in Corona.

Thanks for your help

Are you familiar with the learning corona website?

http://www.learningcorona.com/

There are a few tutorials on there that deal with screen or scene changes. It sounds like you are at a point where you need to figure out how to add that to your app.

I do not know how long ago you were 10, but definitely know that in programming GOTO has been deemed evil and most new languages do not have the GOTO function. Instead they encourage other ways to look at achieving the same without GOTO.

so there are several ways,

mostly it will be to structure your game in a function (more like GOSUB) so what you do it have an endless loop that will call these functions.

something like

while isPlaying==true do
playGame()
-- This will somewhere affect the variable isPlaying and make it false and therefore the loop will exit
loop

now I do not know how you have structured your game, but the idea will be similar... even if you were to use any other language / framework, you will have to think slightly differently.

cheers,

?:)

it should be clear what JayantV explains.
but here are some more examples:

BASIC is an *imperative* language...

1
2
3
4
10  variable = 0
20  variable = variable + 1
30  print variable
40  goto 20
views:1591 update:2011/10/22 17:28:16
corona forums © 2003-2011