Problem with Getting Started

Ofcourse:

18:53:53.696  i = 1 ; SpaceObj[i] type = table

18:53:53.696  {

18:53:53.696    “_class”:{

18:53:53.696      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:53.696      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:53.696      “__index”:"<reference cycle>"

18:53:53.696    },

18:53:53.696    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:53.696    “myName”:“meteor”

18:53:53.696  }

18:53:54.218  i = 2 ; SpaceObj[i] type = table

18:53:54.218  {

18:53:54.218    “_class”:{

18:53:54.218      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.218      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.218      “__index”:"<reference cycle>"

18:53:54.218    },

18:53:54.218    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:54.218    “myName”:“meteor”

18:53:54.218  }

18:53:54.218  i = 1 ; SpaceObj[i] type = table

18:53:54.218  {

18:53:54.218    “_class”:{

18:53:54.218      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.218      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.218      “__index”:"<reference cycle>"

18:53:54.218    },

18:53:54.218    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:54.218    “myName”:“meteor”

18:53:54.218  }

18:53:54.728  i = 2 ; SpaceObj[i] type = table

18:53:54.728  {

18:53:54.728    “_class”:{

18:53:54.728      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.728      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.728      “__index”:"<reference cycle>"

18:53:54.728    },

18:53:54.728    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:54.728    “myName”:“meteor”

18:53:54.728  }

18:53:54.728  i = 1 ; SpaceObj[i] type = table

18:53:54.728  {

18:53:54.728    “_class”:{

18:53:54.728      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.728      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:54.728      “__index”:"<reference cycle>"

18:53:54.728    },

18:53:54.728    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:54.728    “myName”:“meteor”

18:53:54.728  }

18:53:55.228  i = 3 ; SpaceObj[i] type = table

18:53:55.228  {

18:53:55.228    “_class”:{

18:53:55.228      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.228      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.228      “__index”:"<reference cycle>"

18:53:55.228    },

18:53:55.228    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.228    “myName”:“meteor”

18:53:55.228  }

18:53:55.228  i = 2 ; SpaceObj[i] type = table

18:53:55.228  {

18:53:55.228    “_class”:{

18:53:55.228      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.228      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.228      “__index”:"<reference cycle>"

18:53:55.228    },

18:53:55.228    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.228    “myName”:“meteor”

18:53:55.228  }

18:53:55.228  i = 1 ; SpaceObj[i] type = table

18:53:55.228  {

18:53:55.228    “_class”:{

18:53:55.228      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.228      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.228      “__index”:"<reference cycle>"

18:53:55.228    },

18:53:55.228    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.228    “myName”:“meteor”

18:53:55.228  }

18:53:55.748  i = 4 ; SpaceObj[i] type = table

18:53:55.748  {

18:53:55.748    “_class”:{

18:53:55.748      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “__index”:"<reference cycle>"

18:53:55.748    },

18:53:55.748    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.748    “myName”:“meteor”

18:53:55.748  }

18:53:55.748  i = 3 ; SpaceObj[i] type = table

18:53:55.748  {

18:53:55.748    “_class”:{

18:53:55.748      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “__index”:"<reference cycle>"

18:53:55.748    },

18:53:55.748    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.748    “myName”:“meteor”

18:53:55.748  }

18:53:55.748  i = 2 ; SpaceObj[i] type = table

18:53:55.748  {

18:53:55.748    “_class”:{

18:53:55.748      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “__index”:"<reference cycle>"

18:53:55.748    },

18:53:55.748    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.748    “myName”:“meteor”

18:53:55.748  }

18:53:55.748  i = 1 ; SpaceObj[i] type = table

18:53:55.748  {

18:53:55.748    “_class”:{

18:53:55.748      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:55.748      “__index”:"<reference cycle>"

18:53:55.748    },

18:53:55.748    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:55.748    “myName”:“meteor”

18:53:55.748  }

18:53:56.488  i = 5 ; SpaceObj[i] type = table

18:53:56.488  {

18:53:56.488    “_class”:{

18:53:56.488      “removeEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:56.488      “addEventListener”:"<type ‘function’ is not supported by JSON.>",

18:53:56.488      “__index”:"<reference cycle>"

18:53:56.488    },

18:53:56.488    “_proxy”:"<type ‘userdata’ is not supported by JSON.>",

18:53:56.488    “myName”:“meteor”

18:53:56.488  }

18:53:56.488  i = 4 ; SpaceObj[i] type = table

18:53:56.488  {

18:53:56.488    “myName”:“meteor”

18:53:56.488  }

18:53:56.498  ERROR: Runtime error

Well…is it error in engine or it my error anywhere in code?

In your menu.lua file

function scene:create(event) local sceneGroup=self.view local background=display.newImageRect("background.png",760,1300) background.x=display.contentCenterX background.y=display.contentCenterY --Формат RGB-таблицы цветов реализован с делением на 255. local title=display.newText("Welcome to Space Shooter",display.contentCenterX,display.contentCenterY/2.6,native.systemFontBold,48) title:setFillColor(100/255,149/255,237/255) local playButton=display.newText("Play",display.contentCenterX-150,display.contentCenterY+25,native.systemFontBold,56) playButton:setFillColor(105/255,105/255,105/255) local scoreButton=display.newText("Score",display.contentCenterX+150,display.contentCenterY+25,native.systemFont,56) scoreButton:setFillColor( 255/255,239/255,213/255) playButton:addEventListener("tap",GoToGame) scoreButton:addEventListener("tap",GoToScoreTable) end

the display objects that you have created are not being added to the composer scene group.  This means that when you are clicking the start button they are staying on the screen on top of anything that is being created in the game scene.

At the very least you should add "sceneGroup, " to each of the display objects, such as…

local title=display.newText(sceneGroup, "Welcome to Space Shooter",display.contentCenterX,display.contentCenterY/2.6,native.systemFontBold,48)

There are also some issues with your game scene but they should be easier to track down.

Thank you. All work.
And, what is some issues with my game scene?

The code you first posted is removing objects that have left the screen. It appears that object #4 is getting removed somewhere else in your code.  If you look at the first time it prints out you see:

18:53:55.748 i = 4 ; SpaceObj[i] type = table 18:53:55.748 { 18:53:55.748 "\_class":{ 18:53:55.748 "removeEventListener":"\<type 'function' is not supported by JSON.\>", 18:53:55.748 "addEventListener":"\<type 'function' is not supported by JSON.\>", 18:53:55.748 "\_\_index":"\<reference cycle\>" 18:53:55.748 }, 18:53:55.748 "\_proxy":"\<type 'userdata' is not supported by JSON.\>", 18:53:55.748 "myName":"meteor" 18:53:55.748 }

but right before it crashes, it prints this:

18:53:56.488 i = 4 ; SpaceObj[i] type = table 18:53:56.488 { 18:53:56.488 "myName":"meteor" 18:53:56.488 } 18:53:56.498 ERROR: Runtime error

So the _class and _proxy entries are missing. These are the parts that make an object a “display object” that gives it .x and .y properties and so much more.

This tells me there is a display.remove() call happening somewhere else that’s not removing the object from your SpaceObj table, since the code you’re posting does remove it from the table.

Rob

I understood it as:
I forgot some objects in menu.lua as “title”, “playButton” and “scoreButton” add to sceneGroup. And when I start the game then it started, but I didn’t see this —> I tryed load GameScene second time via button that can see. Finally, Corona can’t start game, that was started and I got error about this.

And now all work. Without errors.

I think that can to close this topic, because problem was decided.
Thank all.

As a rule, we leave our forum posts open so others can learn about them. If you want and a particular response solved the problem you can mark the thread solved with which post solved the issue, but that’s not required.

Rob

Right. Just, I know some forums where moderators close topics after best answer, leaving visible them. Thank for information, Rob.