Chapter 5 - asteroids disappeared, at the step right before Hiding the Scene

Hi all,

I need help to my code, please.

I am very new to coding, so I followed Getting Started chapter by chapter. Everything went well until I finished at Chapter 5, Phases and Transitions. Please roll up a little bit from Hiding the Scene, there is a light purple box with “Action!” title. I was at it yesterday. When I ran the simulator, everything went well except the asteroids disappeared entirely! :wacko:

However, according to what the Action purple box mentioned, the game scene should be identically the same though.

Of course the ship won’t die without asteroids, I have no clue if the text update will be correct. There was no Error message either. I tried comparing 3 lua files with chapter’s source files manually, line by line, fixed a few typo, rerun, closed everything and ran again. The asteroids still not show up. I attached my StarExplorer folder as a zip with this post, or you can download it from my google drive.

I renamed the folder name from [StartExplorer] to [StarExplorer_by Olina] just for asking question. In case you think the folder name with the blank is the issue. No, I don’t do it on my computer. The file names main.lua, menu.lua and game.lua with “_from offical”  are the downloaded chapter’s source files.

(I put them in the same folder so that I can compare.) main_original.lua is the file when Chapter 3 finished.

I noticed that I have to compare both code manually. Because earlier I think I should try typing by myself, I didn’t leave the exactly same space as the tutorial showing. I use Visual Studio Code as my editor, and I use compare function in Notepad++, but it will show differences if I don’t have the same space. Is any solution for this?

Finally, I compare them in VS code with split window, I tried to match the code line number to the official one as much as possible. I hope all these help helpers’ work.

Thank you in advance.

Olina

Hi all,

After I post this question, I kept bothering around friends with this question. Otherwise I cannot proceed. A developer friend, ex-coworker, found the issue for me.

I typo gameLoop as gameloop, so the game loop doesn’t run.

It should be:

gameLoopTimer = timer.performWithDelay( 500, gameLoop, 0 )

What I was wrong:

gameLoopTimer = timer.performWithDelay( 500, gameloop, 0 )

As for this post, since I answered my question by myself, I am not sure if I should delete this post to keep the forum clean, or keep it for a future reference? I guess I will leave this decision to Corona official staff to decide.

Thank you!

Olina

Please leave it for future people with the same question.

Thanks and welcome to the forum!

Rob

Hi all,

After I post this question, I kept bothering around friends with this question. Otherwise I cannot proceed. A developer friend, ex-coworker, found the issue for me.

I typo gameLoop as gameloop, so the game loop doesn’t run.

It should be:

gameLoopTimer = timer.performWithDelay( 500, gameLoop, 0 )

What I was wrong:

gameLoopTimer = timer.performWithDelay( 500, gameloop, 0 )

As for this post, since I answered my question by myself, I am not sure if I should delete this post to keep the forum clean, or keep it for a future reference? I guess I will leave this decision to Corona official staff to decide.

Thank you!

Olina

Please leave it for future people with the same question.

Thanks and welcome to the forum!

Rob