Reflection.ExecuteFile "thyme.cfg"; Keys.bind("f12", {System.screenshot}); Keys.bind("pause", {App.Step}); // Press this to take one time step when paused exit = {System.exit}; quit = {System.exit}; print = {Console.print}; time = {Sim.time}; sin = {math.sin}; cos = {math.cos}; spawnBoxRow = (offset, n)=>{for(n, (x)=>{Scene.addBox({pos = offset + [x, 0]})})}; spawnPyramid = (n)=>{for(n, (i)=>{spawnBoxRow([(n - i) * 0.5, n - i], i)})}; // A pyramid of boxes makeRing = (r, n)=>{ list = []; for(n, (i)=>{ a = (2 * math.pi * i) / n; list = list ++ [r * [cos(a), sin(a)]] }); list }; spawnRing = { Scene.addPolygon { surfaces = [ makeRing(1, 48), makeRing(0.5, 48) ] } }; // Creates a 2D-torus groovyOn = { App.fadeColor = [0.8, 0, 0.9]; App.fadeTranslate = { [3 * sin(time), 2 * sin(time)] }; App.fadeRotate = { sin(System.time*1.2) }; App.Background.skyColor = [0,0,0,0]; }; groovyOff = { App.fadeColor = [0, 0, 0]; App.Background.skyColor = [0.3, 0.4, 1, 1]; };