I think it must be something associated with my iPad as I removed lots of files from Photos and Downloads, moved a lot of large files from my Codea folder, ran it again and it still ‘crashed’.
The I tried to record the screen whilst demonstrating this - set the screen video capture loaded and ran the project and it crashed again but when I tried to stop the video it wasn’t running it looks like the crash stopped the video as well (tried a few times and it repeated the crash).
Last resort, posting what I have in pasted into the demo, after my edits, please check on your pads.
Also included details of my system in a snapshot.
-- Template2
-- assert(OrbitViewer)
seed = math.random(1, 10^10)
function setup()
-- Create a new craft scene
scene = craft.scene()
scene.camera:add(OrbitViewer, vec3(0, 0, 0), 10, 0, 100000000)
scene.camera.farPlane = math.maxinteger
generateArea()
end
function generateArea()
scene.voxels.blocks:addAssetPack("Blocks")
local grass = scene.voxels.blocks:new("Grass")
grass.setTexture(ALL, "Blocks:Dirt Grass")
grass.setTexture(UP, "Blocks:Grass Top")
grass.setTexture(DOWN, "Blocks:Dirt")
local snow = scene.voxels.blocks:new("Snow")
snow.setTexture(ALL, "Blocks:Snow")
local sand = scene.voxels.blocks:new("Sand")
sand.setTexture(ALL, "Blocks:Sand")
scene.voxels:resize(vec3(10^4, 1, 10^4))
scene.voxels.visibleRadius = 40
scene.voxels.coordinates = vec3(0, 0, 0)
scene.voxels:iterateBounds(vec3(0, 0, 0), vec3(100, 1, 100), generateVoxels)
end
function update(dt)
-- Update the scene (physics, transforms etc)
scene:update(dt)
end
-- Called automatically by codea
function draw()
update(DeltaTime)
-- Draw the scene
scene:draw()
end
function generateVoxels(x, y, z, id)
local perlin = craft.noise.perlin()
local height = perlin:getValue(x / 280, z / 292, seed)
if height >= math.random(7, 8) / 10 * -1 then
scene.voxels:fill("Grass")
else
if math.random(1, 10000) / height < 500 then
scene.voxels:fill("Snow")
end
end
if height >= .00001 then
scene.voxels:fill("Sand")
end
scene.voxels:block(vec3(x, height * -56, z))
end