Bugs in Getting Started > Star Explorer tutorial

I figured to use this in the Intro to Game Programming class I am teaching and a coding club I am helping with.  Not being real familiar with Corona I went through it first.  Everything went smoothly until the last function, the onCollision event function.  First the error was telling me an “end” was needed to close the function.  I found that one.  There was an extra “end” on the line just above the elseif.  This extra “end” was in the reading and in the downloaded complete program (which also gave the same error).  I fixed that.  Now I am getting “attempt to index global ‘obl1’ (a nil value)” at the line of the second if statement in onCollision.  I get the same error in the downloaded complete program.  This error pops up after the game has run a few seconds.  This one is on the edge of my understanding this language.  I am guessing it has something to do with the way the obj1 object is declared in the event.phase if statement just above the error line but it looks good to me.  

This might be something the Corona website manager might want to correct on the tutorial.  Unless they want new users (me) to get really frustrated.  Other than these little glitches this is going to be great for the coding club for this month.  If I can find the bugs that is.

Can you provide the chapter number where you encountered this? And perhaps copy/paste the code that’s wrong?

We heavily vetted the code vs the working sample (you can download the code for the chapter as well.).

Thanks

Rob

I found the issue.  As usual it was the idiot on this end and not the master code from the site.  When I opened the master code file my editor opened my mis-coded file from the tutorial.  After a quick look at the real master code I could see what the issues was.  The Ch 3 tutorial is very unclear about where various pieces of the collision function get nested.  I did not have everything nested inside the “if event.phase” loop.  There is also an extra “end” at the end of the “if obj1.name” if statement.  When the second part of this if statement, the “elseif” part,  is added to the program that extra “end” has to be replaced with the “elseif”.

Doing this tutorial as a beginner with Corona and a high school teacher I see several places where the tutorial could use just a touch more clarification.  Not a whole lot because overall it is great, but just a touch here and there.

Thank you for making me look closer at what I was doing.  Thank you for also not saying “You are an idiot.  We know it works.”

Thanks for the feedback. I’ll see what we can do to clarify that chapter.

Rob

If you want any help from a high school teacher who would use this stuff in a classroom I would be willing.  Due to my low level of skill in most programming environments I am getting pretty adept at finding things in tutorials that confuse me and my students.  It is best to have somebody with only half a clue do the beta testing on tutorials.  Or someone with no clue but is willing.

Can you provide the chapter number where you encountered this? And perhaps copy/paste the code that’s wrong?

We heavily vetted the code vs the working sample (you can download the code for the chapter as well.).

Thanks

Rob

I found the issue.  As usual it was the idiot on this end and not the master code from the site.  When I opened the master code file my editor opened my mis-coded file from the tutorial.  After a quick look at the real master code I could see what the issues was.  The Ch 3 tutorial is very unclear about where various pieces of the collision function get nested.  I did not have everything nested inside the “if event.phase” loop.  There is also an extra “end” at the end of the “if obj1.name” if statement.  When the second part of this if statement, the “elseif” part,  is added to the program that extra “end” has to be replaced with the “elseif”.

Doing this tutorial as a beginner with Corona and a high school teacher I see several places where the tutorial could use just a touch more clarification.  Not a whole lot because overall it is great, but just a touch here and there.

Thank you for making me look closer at what I was doing.  Thank you for also not saying “You are an idiot.  We know it works.”

Thanks for the feedback. I’ll see what we can do to clarify that chapter.

Rob

If you want any help from a high school teacher who would use this stuff in a classroom I would be willing.  Due to my low level of skill in most programming environments I am getting pretty adept at finding things in tutorials that confuse me and my students.  It is best to have somebody with only half a clue do the beta testing on tutorials.  Or someone with no clue but is willing.