26 Apr 2013, 20:13
Generic-user-small

Lloyd Blake (5 posts)

Hello,

When I run the shooting main.lua file via my simulator it crashes each time, here is an extract from the crash error message:

Process: Corona Simulator [734] Path: /Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator Identifier: com.anscamobile.Corona_Simulator Version: 2013.1076 (2013.1076) Code Type: X86-64 (Native) Parent Process: launchd [116] User ID: 501

Date/Time: 2013-04-26 21:05:09.426 +0100 OS Version: Mac OS X 10.8.3 (12D78) Report Version: 10

Interval Since Last Report: 404932 sec Crashes Since Last Report: 5 Per-App Interval Since Last Report: 25301 sec Per-App Crashes Since Last Report: 5 Anonymous UUID: F1E184D7-84B5-FA61-F2F5-4F23C5CFB9C3

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000019338

VM Regions Near 0x19338:

Lloyd

26 Apr 2013, 21:23
Silvias_temp_avatar_pragsmall

Silvia Domenech (35 posts)

Hi Lloyd,

It’s great to know that you’re reading the chapters and compiling the projects, but I’m sorry to read that you were not able to run the shooting chapter code.

I just downloaded the code files from the beta version, and they ran well on my version of the simulator. Since I’m not sure of the problem that causes the error, I hope you won’t mind if I ask you a few questions to help determine the cause of the problem.

  1. Are you able to run the other projects, or is this the only one that gives you trouble?
  2. Is this error triggered as soon as you launch the game, or are you able to tap on the screen to go to the game scene?

I’m using version 2013.1088 of the simulator (which is a bit newer than 1076). I’m going to download your version in case it’s related to this. Edit: I downloaded the older version and the program worked. It might be a configuration issue, so I await your response.

27 Apr 2013, 09:32
Silvias_temp_avatar_pragsmall

Silvia Domenech (35 posts)

Hi again,

I have used the Corona SDK in different computers, and I was unable to get your error unless I used a cloud-based Mac OS environment (macincloud). In that setting, the program crashed a significant number of times when opening the Shooting chapter, but also when opening any other project, even the sample apps that are distributed with the Corona simulator.

Are you using a virtual Mac environment like this to access the simulator, or are you using a traditional computer?

Silvia

27 Apr 2013, 17:06
Generic-user-small

Lloyd Blake (5 posts)

Hi Silvia,

I am running on an iMac with 10.8.3 the game crashes when I tap (click) on the screen. I tried using different iPhone version via the simulator but that makes no difference. I’ll take another look at this issue once I’ve been through the tutorial and look at the code to see if I can see anything that could be causing the crash?

Lloyd

28 Apr 2013, 01:11
Silvias_temp_avatar_pragsmall

Silvia Domenech (35 posts)

Hi Lloyd,

Good news!

There’s a command in the chapter codes that makes the simulator crash on some systems, but not on others. In the physics initialisation code in game.lua (lines 17-20), physics.start() and physics.setGravity( 0, 0 ) are swapped. setGravity() has to go after start(), but the chapter codes call the functions the other way round.

The physics code should look like this:

-- Initialise physics
physics = require("physics")
physics.start()
physics.setGravity( 0, 0 )
physicsData = (require "shipphysics").physicsData(1)

The same change is needed in the Sound chapter.

Thanks for your help and for posting details about your system. I wouldn’t have noticed the bug without first reading your comment and testing the code on a machine with similar specs.

As a side note, the x coordinate for the parallax image in these three projects isn’t set properly on Mac (the default x coordinate is set differently on the Windows and Mac simulators), so that will have to be fixed in the next update.

Thanks again, and have fun using Corona.

  You must be logged in to comment