This code crashes when the number of objects reaches 1049.
I did not find any mention of restrictions in the documentation. It's probably some kind of mistake.
AppGameKit Studio has this same error.
SetErrorMode(2)
SetWindowTitle( "PB" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
shadowMode = 3
SetShadowMappingMode( shadowMode )
SetShadowSmoothing( 2 )
SetShadowMapSize( 1024, 1024 )
SetShadowRange( -1 )
SetShadowBias( 0.0012 )
SetSunDirection( -0.5, -1, -0.5 )
Create3DPhysicsWorld()
Set3DPhysicsGravity(0,-1,0)
CreateObjectBox( 1, 400,2,400 )
Create3DPhysicsStaticBody( 1 )
SetObjectShapeBox(1)
SetObjectColor(1,50,100,200,255)
SetCameraPosition( 1, 100, 100, -100 )
SetCameraLookAt( 1, 0, 0, 0, 0 )
local objID as integer
objID = 2
do
//CreateObjectBox( objID, 1.9,1.9,1.9 )
CreateObjectSphere(objID,3,16,16)
SetObjectCastShadow( objID, 1 )
SetObjectPosition( objID, (random(0,20)-5)*2 ,random(40,70) , (random(0,20)-5)*2 )
SetObjectColor(objID,random(100,250),random(100,250),random(200,250),255)
Create3DPhysicsDynamicBody( objID )
//SetObjectShapeBox(objID)
SetObjectShapeSphere(objID,3)
objID = objID+1
Print( objID-2 )
Print( ScreenFPS() )
Step3DPhysicsWorld()
Sync()
loop