Hello, this is my first weekend attempt at making some simple code. It seems to work fine in the Corona Simulator, but it crashes on the Xcode Simulator and my iPhone 4 device. Hopefully someone can look into it and see why it’s crashing?
local physics = require ("physics")
physics.start()
-- hide the status bar
display.setStatusBar(display.HiddenStatusBar)
-- set gravity
physics.setGravity(0,10)
-- set object physics
borderBodyElement = { friction=0.5, bounce=0.3 }
StandardObjectElement = { density=2, friction=0.5, bounce=1 }
-- add borders
local borderTop = display.newRect( 0, 0, display.contentWidth, 20 )
physics.addBody( borderTop, "static", borderBodyElement )
local borderBottom = display.newRect( 0, display.contentHeight-20, display.contentWidth, 20 )
physics.addBody( borderBottom, "static", borderBodyElement )
local borderLeft = display.newRect( 0, 20, 20, display.contentHeight-20 )
physics.addBody( borderLeft, "static", borderBodyElement )
local borderRight = display.newRect( display.contentWidth-20, 20, 20, display.contentHeight-20 )
physics.addBody( borderRight, "static", borderBodyElement )
-- add text object
local textObject = display.newText( "BEYONDTHETECH", display.contentWidth/2, display.contentHeight/2, "Eurostile", 24 )
textObject:setTextColor( 255,255,255 )
physics.addBody(textObject, StandardObjectElement )
-- rotate it randomly
function textObject:tap( event )
transition.to(textObject, { time=1000, rotation=math.random(0,360) } )
end
-- enable tap for text object
textObject:addEventListener ( "tap", textObject )
And this is the Console log in Xcode’s Organizer:
[blockcode]Sat Oct 23 11:27:35 Raphaels-iPhone-4 Game[3815] : Loading AX for: Game**
Sat Oct 23 11:27:36 Raphaels-iPhone-4 UIKitApplication:Game[0x9f61][3815] : Assertion failed: (area > 1.19209290e-7F), function ComputeMass, file /Users/ansca/.hudson/jobs/Pong-DMG/workspace/platform/iphone/…/…/external/Box2D_v2.1.2/Box2D/Box2D/Collision/Shapes/b2PolygonShape.cpp, line 428.
Sat Oct 23 11:27:37 Raphaels-iPhone-4 ReportCrash[3818] : Formulating crash report for process Game[3815]
Sat Oct 23 11:27:37 Raphaels-iPhone-4 com.apple.launchd[1] (UIKitApplication:Game[0x9f61][3815]) : (UIKitApplication:Game[0x9f61]) Job appears to have crashed: Abort trap
Sat Oct 23 11:27:37 Raphaels-iPhone-4 SpringBoard[28] : Application ‘Game’ exited abnormally with signal 6: Abort trap
Sat Oct 23 11:27:37 Raphaels-iPhone-4 ReportCrash[3818] : Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Game_2010-10-23-112736_Raphaels-iPhone-4.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
[/blockcode]
Hopefully it’s something simple that I’m doing or not doing? Thanks in advance. [import]uid: 6084 topic_id: 3024 reply_id: 303024[/import]