Need Help With Various Bugs In My Project

Hello,

http://github.com/Darith1974/Lua-Corona-Mobile-App-Space-Invaders

I have my space invaders app at the above github repository. Trying to fix a few bugs which i cannot fathom:

First bug:

Transition from scene 4i to scene5:

Unfortunately when I transition form this scene to Scene 5 physics will
not work properly. The main soldier sprite will not obey gravity properly and
acts strangely to events. I do not why. Sometimes if one starts the game from
say scene 4a or 4c it works and maybe even from scene1a. But it is too
inconsistent. I spend a few hours trying to find out why and trying various
things but to no avail. I though it was scope in that in scene5 I originally
set group to global within createScene. I then initiated physics from main.lua.
I tried creating a transition from blank scene in between the problem levels.
There is a flip command associated with storyboard.The only reason I can come up
with is that corona or storyboard cannot handle purging all the previous scenes
with all the physics and then moving onto a totally different scene with
different objects and physics. It could be that I am not removing objects
properly or handling collisions; the simulator is getting bogged down and maybe
half crashing.  The subsequent levels
will work fine if one starts the game at scene5 and progresses onwards. 

Second Bug:

I implemented the sound for collisions within the classes. There is a delay from when the
collision happens to the actual sound been rendered? Even if I run from main.lua
this strange behaviour happens.

Third bug:

The clock acts weird in later levels in that it jumps 3 to 5 seconds at a time.

This could be due to the stress I am maybe putting the simulator under. Or another

reason is that I implemented the timeScore fn incorrectly

Fourth bug:

During
the final testing for reasons unknown when I start the game from scene5, the
game will terminate to GameEnd at scene8 or 8a for some unknown reason even
though I did not alter the code

 

I downloaded from git and get this error in the terminal

WARNING: Failed to find image(BG1.jpg)

Runtime error

    …e-Invaders-master/Space invaders Scences/scene1a.lua:101: attempt to index global ‘background1’ (a nil value)

stack traceback:

    [C]: ?

    …e-Invaders-master/Space invaders Scences/scene1a.lua:101: in function <…e-Invaders-master/Space invaders Scences/scene1a.lua:96>

    ?: in function ‘dispatchEvent’

    ?: in function ‘gotoScene’

    …ace-Invaders-master/Space invaders Scences/intro.lua:13: in function <…ace-Invaders-master/Space invaders Scences/intro.lua:12>

    ?: in function <?:229>

Copyright © 2009-2012  C o r o n a   L a b s   I n c .

    Version: 2.0.0

    Build: 2012.912

The file sandbox for this project is located at the following folder:

    (/Users/matt/Library/Application Support/Corona Simulator/Space invaders Scences-3D7223A97B439A23D13637C883B38FA4)

I think you first should fix the case of all your files names. Im guessing you are on Windows? That would probably solve the initial crash. Remember to name your files exactly the same as what you reference in lua, they need to be the same case.

The sound, are you preloading the sounds before the level starts? If not they load when played which caused delays.

Nothing seems to fit the screen either so its hard to look at the game / code at the moment.

I just downloaded the zip from github and it ran ok for me. I am using build 840 in the free version of the Corona Simulator. I am currently checking my file names. I am not pre loading sounds although i do understand what you mean by this exactly?  I am also using the droid view, unsure if this has any reference to your last comment.

Yes  i am running on vista.

Thats your problem, running windows, for the file names at least. Windows sees IMAGE.JPG and image.jpg as the same files. Unix and Linux do not and see them as two different files. As iOS is Unix and Android is Linux I would recommend you name your files correctly or you will have issues while building for devices.

Did you say you do not understand how to preload sounds?

I downloaded from git and get this error in the terminal

WARNING: Failed to find image(BG1.jpg)

Runtime error

    …e-Invaders-master/Space invaders Scences/scene1a.lua:101: attempt to index global ‘background1’ (a nil value)

stack traceback:

    [C]: ?

    …e-Invaders-master/Space invaders Scences/scene1a.lua:101: in function <…e-Invaders-master/Space invaders Scences/scene1a.lua:96>

    ?: in function ‘dispatchEvent’

    ?: in function ‘gotoScene’

    …ace-Invaders-master/Space invaders Scences/intro.lua:13: in function <…ace-Invaders-master/Space invaders Scences/intro.lua:12>

    ?: in function <?:229>

Copyright © 2009-2012  C o r o n a   L a b s   I n c .

    Version: 2.0.0

    Build: 2012.912

The file sandbox for this project is located at the following folder:

    (/Users/matt/Library/Application Support/Corona Simulator/Space invaders Scences-3D7223A97B439A23D13637C883B38FA4)

I think you first should fix the case of all your files names. Im guessing you are on Windows? That would probably solve the initial crash. Remember to name your files exactly the same as what you reference in lua, they need to be the same case.

The sound, are you preloading the sounds before the level starts? If not they load when played which caused delays.

Nothing seems to fit the screen either so its hard to look at the game / code at the moment.

I just downloaded the zip from github and it ran ok for me. I am using build 840 in the free version of the Corona Simulator. I am currently checking my file names. I am not pre loading sounds although i do understand what you mean by this exactly?  I am also using the droid view, unsure if this has any reference to your last comment.

Yes  i am running on vista.

Thats your problem, running windows, for the file names at least. Windows sees IMAGE.JPG and image.jpg as the same files. Unix and Linux do not and see them as two different files. As iOS is Unix and Android is Linux I would recommend you name your files correctly or you will have issues while building for devices.

Did you say you do not understand how to preload sounds?