Skip to content

Instantly share code, notes, and snippets.

@dreness
Last active April 17, 2023 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreness/7df398708c0407ce8c98729d18f28a85 to your computer and use it in GitHub Desktop.
Save dreness/7df398708c0407ce8c98729d18f28a85 to your computer and use it in GitHub Desktop.
A bunch of Algodoo script snippets, extracted from public files

... is pretty great. If you somehow arrived here without knowing what Algodoo is, I implore you to go try it right now.

I had a hard time finding good examples of Thyme code on ye interwebs, and this document tries to remedy that. I downloaded a bunch of public compositions by the talented matto and then made a Jupyter notebook to extract interesting Thyme snippets from the project files (which are just zip archives after all). For this purpose, I define "interesting" as:

  • Not too long
  • Not too similar to a previously seen snippet

The notebook is attached at the end of this gist if you want to run the same process on your own bag of Algodoo compositions.

Also note that matto made videos about many of these compositions, so definitely check those out.

Other userful resources:

  • Thyme Language Guide
  • Thyme Property reference
  • desmos.com is a nice web-based graphing calculator. This is useful for tweaking parameteric equations, for example the linked graph was used to figure out an equation for adjusting an Algodoo object's attraction property over time, and is installed in the onUpdate callback as shown below. We substitute x for sim.time, and replace the divisor constant with a variable to more quickly visualize the equation using different values.

onUpdateParametric

image

thyme.cfg

First, here are the contents of thyme.cfg from inside the app bundle, which is probably the closest thing to official documentation for this scripting language.

Thyme is the homebrew scrpting language in Algodoo/Phun.
There are four atom types in thyme: Int, Float, Bool and String.
These types can then be used to construct aggregate types, such as Lists, and Functions.
Identifiers are declared using operator:= and changed using operator=. An identifier is typeless.

foo := 3; // Declares a new identifier "foo" with an initial integer vale
foo = [foo, "hello", true];  // Assigns a list to the previously declared variable 'foo'. The list is heterogenous.
print foo(1); // prints "hello"
print foo([0,2]); // prints [3, true]
isEven := (n)=>{ n%2==0 }; // Declares a function "isEven" that takes one argument and returns true if it's even
*/

/* for - A simple looping structure in Thyme.
Used like this: for(n, (i)=>{ ... });
... where n is the number of times to call the function.
    i will be given the values 0, 1, ..., n-2, n-1
Example:
	for(4, (n)=>{print ((n+1) + " bottles of beer on the wall.")})
Output:
	1 bottles of beer on the wall.
	2 bottles of beer on the wall.
	3 bottles of beer on the wall.
	4 bottles of beer on the wall.
*/

for = (n, what)=>{
    n <= 0 ? false : {
        for(n - 1, what);
        what(n-1)
    }
};

/* if - A simple if structure in Thyme.
Used like this: if(c, { ... }); where c is the condition that needs to be true for the function in {} to be executed
Example:
    if(true, {print "This will be written."});
    if(false, {print "This will be ignored."});
Output:
    This will be written.

if = (c, s)=>{
    c ? {s} : undefined
};

inclusive_range = (min, max)=>{min > max ? [] : {[min] ++ inclusive_range(min + 1, max)}};
infix 5 left: _ .. _ => inclusive_range; // Usage:  1..5 == [1,2,3,4,5]

math.max = (a,b)=>{ a > b ? a : b };
math.min = (a,b)=>{ a < b ? a : b };

// The sum of the components of a real vector
math.sum = (v)=>{
	ret = 0;
	for(string.length(v), (i)=>{
		ret = ret + v(i)
	});
	ret  // Return this
};

// Bench the time it takes to take a few simulation steps.
Bench_Steps = (n)=>{t := System.time; Sim.Step_N(n); Console.print(n + " steps took " + (System.time-t) + " seconds.") };

// Vector library (assumes 2-component vectors)
math.vec = alloc;
math.vec.lenSq  = (v)=>{ (v(0))^2 + (v(1))^2 };
math.vec.len    = (v)=>{ ( (v(0))^2 + (v(1))^2 )^.5 };
math.vec.distSq = (a,b)=>{ math.vec.lenSq(a-b) };
math.vec.dist   = (a,b)=>{ math.vec.len(a-b) };

// Example functionss
spawnBoxRow = (offset, n)=>{for(n, (x)=>{Scene.addBox({pos = offset + [x, 0]})})};
spawnRing = {Scene.addPolygon({surfaces = [makeRing(1, 48), makeRing(0.5, 48)]})};
makeRing = (r, n)=>{
    list = [];
    for(n, (i)=>{
        a = (2 * math.pi * i) / n;
        list = list ++ [r * [cos(a), sin(a)]]
    });
    list  // Return this
};

Poached from matto's compositions

The examples are grouped by the function they are defining: postStep, update, onCollide, onKey.

postStep

/Convective_motion_fluid_particle_simulator/scene.phn

postStep := (e)=>{
        _count = _count + 1.0000000e-07;
        density = density + _count;
        density > 0.010500000 ? {
            density = 0.010500000;
            _count = 0
        } : {};
        c = density * 100;
        f = (density * 100) * (-1) + 1;
        k = (vel(0) ^ 2 + vel(1) ^ 2) ^ 0.50000000;
        P = 1 / k;
        color = [0, f + k, 1, 1]
    };

/Compact_laser_with_automatic_aim/scene.phn

postStep := (e)=>{
        scene.my.ang1 = angle
    };

/Compact_laser_with_automatic_aim/scene.phn

postStep := (e)=>{
        my.scene.Xpallona = pos(0);
        my.scene.Ypallona = pos(1);
        my.scene.angPallona = angle
    };

/Compact_laser_with_automatic_aim/scene.phn

postStep := (e)=>{
        scene.my.a3 = angle
    };

/Compact_laser_with_automatic_aim/scene.phn

postStep := (e)=>{
        Xpallona = my.scene.Xpallona;
        Xpallina = my.scene.Xpallina;
        Xpallina = pos(0);
        Ypallina = pos(1);
        XX = Xpallina - Xpallona;
        YY = Ypallina - Ypallona;
        angolo = math.atan(YY / XX);
        my.scene.angolo = angolo;
        my.scene.Xpallina = pos(0);
        my.scene.Ypallina = pos(1)
    };

/Compact_laser_with_automatic_aim/scene.phn

postStep := (e)=>{
        a1 = scene.my.ang1;
        a2 = scene.my.ang2;
        aa = a1 - a2;
        aa > (-2) ? {
            fadeDist = 0
        } : {
            fadeDist = 300
        }
    };

/Radar_laser/scene.phn

postStep := (e)=>{
                scene.my.p = pos
            };
            opaqueBorders := true;
            geomID := 11223;
            body := 0;
            edgeBlur := 0.0099999998;
            angle := -0.85762119;
            zDepth := 7.0000000;
            layer := 0
        })
    };

/Mechanism_of_the_two_mouth_of_Alien/scene.phn

postStep := (e)=>{
        q = (math.sin(sim.time * 5)) * 16;
        colorHSVA = [230.00000 + q, 1.0000000, 1.0000000, 1.0000000]
    };

/Realistic_insect_laser_sensor_automatically_avoid_obstacle/scene.phn

postStep := (e)=>{
        scene.my.k = 2;
        scene.my.min = 1.4000000
    };

/Realistic_insect_laser_sensor_automatically_avoid_obstacle/scene.phn

postStep := (e)=>{
        q = math.sin(sim.Time * 2);
        motorSpeed = q
    };

/Realistic_insect_laser_sensor_automatically_avoid_obstacle/scene.phn

postStep := (e)=>{
        q = scene.my.S3;
        k = scene.my.k;
        m = scene.my.min;
        q < m ? {
            force = (m - q) * k
        } : {
            force = 0
        }
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.S3;
        k = scene.my.k;
        m = scene.my.min;
        q < m ? {
            force = (m - q) * k
        } : {
            force = 0
        }
    };

/Self_pilot_two_engine_stabilized_drone/scene.phn

postStep := (e)=>{
        my.scene.AngLed < 0 ? {
            color = [1.0000000, 1.0000000, 0.0000000, 1.0000000]
        } : {
            color = [0, 0, 0, 0]
        }
    };

/Self_pilot_two_engine_stabilized_drone/scene.phn

postStep := (e)=>{
        my.scene.UpDown = ((pos(1) - 70.699997) * (-1)) * 10;
        my.scene.DxSx = ((pos(0) - 64.300003) * (-1)) * 10
    };

/Self_pilot_two_engine_stabilized_drone/scene.phn

postStep := (e)=>{
        my.scene.magnet < 0 ? {
            attraction = 200;
            color = [1.0000000, 0.0000000, 0.0000000, 1.0000000]
        } : {
            attraction = 0;
            color = [0.0000000, 0.0000000, 1.0000000, 1.0000000]
        };
        my.scene.attract = attraction
    };

/Self_pilot_two_engine_stabilized_drone/scene.phn

postStep := (e)=>{
        my.scene.magnet = angle
    };

/Self_pilot_two_engine_stabilized_drone/scene.phn

postStep := (e)=>{
        fadeDist = 2 + my.scene.DX + (my.scene.p1 * (-1));
        fadeDist < 0 ? {
            fadeDist = (fadeDist * (-1) / 6)
        } : {}
    };

/Stabilized_remote_controller_four_engine_drone_sript/scene.phn

postStep := (e)=>{
        fadeDist = 2 + my.scene.DX + (my.scene.p1 * (-1));
        fadeDist < 0 ? {
            fadeDist = (fadeDist * (-1) / 6)
        } : {}
    };

/Self_pilot_two_engine_stabilized_drone/scene.phn

postStep := (e)=>{
        force = 20 + my.scene.SX + (my.scene.p1 * (-1)) + (((my.scene.p0 * (-1)) * 0.10000000));
        my.scene.forceSx = force
    };

/self_equilibrium/scene.phn

postStep := (e)=>{
        scene.my.tpNo0 = pos + [0, 0]
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        _time > 1818 && _time < 3400 ? {
            _closed = 2.9600000
        } : {
            _closed = 0
        };
        _time = scene.my.time;
        angvel = (_closed - angle) * 40
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        scene.my.p = pos
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        vel = ((scene.my.p + _p) - (pos)) * 10;
        _X = pos(0) - scene.my.p(0);
        _x > (-0.050000001) && _x < 0.050000001 ? {_x = 0} : {};
        scene.my.x = _X
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        scene.my.x < _x ? {
            color = [0.0000000, 1.0000000, 0.50000000, 1.0000000]
        } : {
            color = [1.0000000, 0.0000000, 0.0000000, 0.0000000]
        }
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        _time = scene.my.time;
        _time > 0 ? {
            textColor = [0.0000000, 1.0000000, 0.0000000, 1.0000000]
        } : {
            textColor = [1.0000000, 1.0000000, 1.0000000, 0.0000000]
        };
        _tim = (math.sin(_time * 0.050000001)) * 0.20000000;
        textScale = 1.2000000 + _tim
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        _time = scene.my.time;
        _time > 0 ? {
            color = [1.0000000, 1.0000000, 1.0000000, 0.0000000]
        } : {
            color = [1.0000000, 1.0000000, 1.0000000, 1.0000000]
        }
    };

/Catching_puppets_crane/scene.phn

postStep := (e)=>{
        _time = scene.my.time;
        _time > 0 ? {
            color = [1.0000000, 1.0000000, 1.0000000, 1]
        } : {
            color = [1.0000000, 1.0000000, 1.0000000, 0.0000000]
        }
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        scene.my.pp1 = pos
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        q = scene.my.rad1;
        radius = 0.020000000 + (q * 0.020000000);
        radius > 0.80000001 ? {
            _c = _c + 0.10000000
        } : {_c = 0};
        colorHSVA = [180.00000 + (_c * 1000), 1.0000000, 1.0000000, 0.69999999 - _c]
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        _qq = _qq + 1;
        q = ((math.sin(_qq * radius * 3)) * 0.30000001);
        scene.my.fire == 1 ? {
            color = [1.0000000, 0.0000000 + q, 0.0000000, 1.0000000]
        } : {
            color = [0.0000000, 1.0000000, 1.0000000, 0]
        };
        edgeBlur = 0.60000002 + q
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        scene.my.fire = _qq
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        scene.camera.zoom = _k + (angle * _k1)
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        scene.my.qq = _q
    };

/Plasma_cannon/scene.phn

postStep := (e)=>{
        vel = [6, 3];
        scene.my.qq == 1 ? {
            timeToLive = 0
        } : {}
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        vel = (_p - pos) * 5;
        angvel = (0 - angle) * 5;
        cc = _v * 155;
        cc > 100 ? {cc = 100} : {};
        colorHSVA = [120 + cc, 1, 1, (_v * 4) - 0.40000001]
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        _tt = _tt + 0.69999999 + rand.normal;
        _tt > 50 ? {
            _ball2;
            _tt = 0
        } : {}
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        angle < 0.14000000 ? {_N = 1} : {};
        angle > 3 ? {_N = 0} : {};
        scene.my.n = _N
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        scene.my.pm = pos
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        q = scene.my.n;
        q == 0 ? {
            ccw = false
        } : {
            ccw = true
        }
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        _v == 1 ? {_v1} : {};
        _v == 2 ? {_v2} : {};
        _v == 3 ? {_v3} : {};
        _v == 4 ? {_v4} : {};
        angvel = 19 + ((math.sin(sim.time)) * 10)
    };

/Magic_shield/scene.phn

postStep := (e)=>{
        _qq = _qq + 0.0099999998;
        ta = math.sin(_qq + pos(0) + pos(1));
        ta > 0.99299997 ? {
            color = [1.0000000, 1.0000000, 1.0000000, 1.0000000]
        } : {
            color = [1.0000000, 1.0000000, 1.0000000, 0]
        }
    };

/BAINO_series_presentation/scene.phn

postStep := (e)=>{
        q = (math.sin(sim.time * 4)) * 100;
        colorHSVA = [q, 0.50000000, 0.50000000, 1]
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        my.scene.p = pos(1);
        my.scene.po = pos(0);
        vel(0) < (-20) ? {
            vel = [-20, vel(1)]
        } : {};
        vel(0) > 20 ? {
            vel = [20, vel(1)]
        } : {}
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        c = my.scene.motorSx;
        color = [c, 0.50000000, 1, 1]
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        q = rand.normal;
        color = [0.55306399, 0.35445884 + q, 0.93430424, 1.0000000]
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        my.scenepSx = pos(1)
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        q = sin(sim.time);
        color = [0.0000000 + q, 1.0000000, 0.0000000, 1.0000000]
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        q = rand.normal;
        color = [0.0000000 + q, 0.83333331, 0.83333331, 1.0000000]
    };

/Pong_playtig_alone_NO_human_control/scene.phn

postStep := (e)=>{
        c = 1 / ((my.scene.po - pos(0)) ^ 2 + (my.scene.p - pos(1)) ^ 2) ^ 0.50000000;
        color = [0, c, c, 0.10000000]
    };

/Brachistochrone_curve_with_timer/scene.phn

postStep := (e)=>{
        my.scene.red = sim.time
    };

/Brachistochrone_curve_with_timer/scene.phn

postStep := (e)=>{
        my.scene.yel = sim.time
    };

/Brachistochrone_curve_with_timer/scene.phn

postStep := (e)=>{
        my.scene.cyan = sim.time
    };

/Circular_fractal_vise_automatic_succession_of_objects/scene.phn

postStep := (e)=>{
        scene.my.a = angle
    };

/Circular_fractal_vise_automatic_succession_of_objects/scene.phn

postStep := (e)=>{
        timetolive < 1 ? {
            _kk = timetolive
        } : {_kk = 1};
        colorhsva = [colorhsva(0), colorhsva(1), colorhsva(2), _kk]
    };

/Circular_fractal_vise_automatic_succession_of_objects/scene.phn

postStep := (e)=>{
        _k = scene.my.k;
        _k == 0 ? {_k = 16} : {}
    };

/Realistic_fireworks_script/scene.phn

postStep := (e)=>{
        _tt = _tt + 0.50000000 + rand.normal;
        _tt > 200 ? {
            _fire;
            _tt = 0
        } : {}
    };

/Realistic_fireworks_script/scene.phn

postStep := (e)=>{
        _t = _t + 1;
        colorHSVA = [_t, colorHSVA(1), colorHSVA(2), colorHSVA(3)]
    };

/Ferrocell_simulation_magnetic_visualizer/scene.phn

postStep := (e)=>{
        my.scene.a0 = pos(0);
        my.scene.a1 = pos(1)
    };

/Ritual_animation_script/scene.phn

postStep := (e)=>{
        x = scene.my.x;
        y = scene.my.y;
        y0 = 1 - y;
        pos1 = [5.4431381, 4.0353260] * [y, y];
        pos2 = [4.9819031, 15.721291] * [y0, y0];
        pos = pos1 + pos2
    };

/Ritual_animation_script/scene.phn

postStep := (e)=>{
        x = scene.my.x;
        color = [0.0000000, 1.0000000, 1.0000000, x];
        q = rand.normal;
        w = rand.normal;
        w1 = w * (x / 35);
        q1 = q * (x / 35);
        pos = [5.4460044 + w1, 3.1181543 + q1]
    };

/Ritual_animation_script/scene.phn

postStep := (e)=>{
        x = scene.my.x;
        refractiveIndex = 1 - x
    };

/Ritual_animation_script/scene.phn

postStep := (e)=>{
        x = scene.my.x;
        color = [0.0000000, 1.0000000, 0.083333254, x];
        q = rand.normal;
        w = rand.normal;
        w1 = w * (x / 15);
        q1 = q * (x / 15);
        pos = [5.4460044 + w1, 3.1181543 + q1]
    };

/Ritual_animation_script/scene.phn

postStep := (e)=>{
        x = pos(0);
        y = pos(1) / 2;
        x < 0 ? {x = 0} : {};
        y < 0 ? {y = 0} : {};
        scene.my.x = x;
        scene.my.y = y
    };

/ECO_localization/scene.phn

postStep := (e)=>{
        scene.my.angle = angle;
        scene.my.pos = pos
    };

/ECO_localization/scene.phn

postStep := (e)=>{
        q = scene.my.r;
        color = [1.0000000, 1.0000000, 0.0000000, q]
    };

/ECO_localization/scene.phn

postStep := (e)=>{
        angle = scene.my.angle;
        pos = scene.my.pos
    };

/ECO_localization/scene.phn

postStep := (e)=>{
        q = scene.my.r;
        fadeDist = 2.5000000 - q;
        fadeDist < 0 ? {
            fadeDist = 0
        } : {}
    };

/ECO_localization/scene.phn

postStep := (e)=>{
        q = scene.my.laserSX;
        fadeDist = q / 3
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        scene.my.pos1 = pos;
        scene.my.angle1 = angle
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        _k == 1 ? {
            _rad = _rad + 0.0049999999;
            radius = 0.69999999 + _rad;
            color = [1, 1, 1, 0.50000000 - (_rad / 2.2000000)];
            density = 0.10000000 - (_rad / 5);
            density < 0.0010000000 ? {
                density = 0.0010000000
            } : {}
        } : {}
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        scene.my.acc = angle
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        scene.my.onoff = _onoff
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        fri = scene.my.fri;
        collideSet = fri;
        fri == 1 ? {
            color = [0.0000000, 1.0000000, 0.0000000, 0.75000000]
        } : {};
        fri == 0 ? {
            color = [1.0000000, 0.0000000, 0.0000000, 0.75000000]
        } : {}
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        scene.my.fri = _fri
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.fri = _fri
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        q = scene.my.poss + [8, 78];
        w = q - pos;
        vel = w
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

postStep := (e)=>{
        scene.my.smoke = _smoke
    };

/Stabilized_remote_controller_four_engine_drone_sript/scene.phn

postStep := (e)=>{
        my.scene.UpDown = ((pos(1) - 10.197667) * (-1)) * 40;
        my.scene.DxSx = ((pos(0) - 12.198166) * (-1)) * 40
    };

/Stabilized_remote_controller_four_engine_drone_sript/scene.phn

postStep := (e)=>{
        my.scene.SX = angvel + angle;
        my.scene.DX = (angvel + angle) * (-1);
        my.scene.p0 = my.scene.DxSx + pos(0) + vel(0);
        my.scene.p1 = my.scene.UpDown + pos(1) + vel(1);
        my.scene.AngLed = angle
    };

/Stabilized_remote_controller_four_engine_drone_sript/scene.phn

postStep := (e)=>{
        my.scene.AngLed < 0 ? {
            color = [1.0000000, 0.0000000, 0.0000000, 1.0000000]
        } : {
            color = [0, 0, 0, 0]
        }
    };

/Stabilized_remote_controller_four_engine_drone_sript/scene.phn

postStep := (e)=>{
        force = 15 + my.scene.SX + (my.scene.p1 * (-1))
    };

/Arduino_line_follower_laser_script/scene.phn

postStep := (e)=>{
        p = scene.my.SX;
        p > 0 ? {
            color = [0, 1, 0, 1]
        } : {
            color = [1, 0, 0, 1]
        }
    };

/Arduino_line_follower_laser_script/scene.phn

postStep := (e)=>{
        force = scene.my.DX
    };

/Air_conditioner_simulator_script/scene.phn

postStep := (e)=>{
        _count = _count - 9.9999999e-09;
        density = density + _count;
        density < 0.0010000000 ? {
            density = 0.0010000000;
            _count = 0
        } : {};
        c = density * 30;
        f = (density * 100) * (-1) + 1;
        color = [0, 0, 1, c]
    };

/Self_sync/scene.phn

postStep := (e)=>{
        scene.my.p = pos(0)
    };

/Snake_Nokya_working_script/scene.phn

postStep := (e)=>{
        scene.my.end == 1 ? {
            timetolive = 0
        } : {}
    };

/Snake_Nokya_working_script/scene.phn

postStep := (e)=>{
        _t = _t + 0.20000000;
        _sin = math.sin(_t);
        _sin > (-0.60000002) ? {
            textcolor = [0, 0, 0, 1.0000000]
        } : {
            textcolor = [1.0000000, 1.0000000, 1.0000000, 0]
        };
        scene.my.start == 1 ? {
            timetolive = 0
        } : {}
    };

/Snake_Nokya_working_script/scene.phn

postStep := (e)=>{
        App.GUI.playMode = true
    };

/Self_solve_the_maze/scene.phn

postStep := (e)=>{
        pos = scene.my.Centro;
        angle = 0
    };

/Self_solve_the_maze/scene.phn

postStep := (e)=>{
        _anv;
        _dira;
        pos = scene.my.Centro;
        _move = scene.my.direzione;
        angvel = (_aa - angle) * 6;
        colorHSVA = [15.000000, 0.0000000 + _ve, 1.0000000, 1.0000000]
    };

/Self_solve_the_maze/scene.phn

postStep := (e)=>{
        pos = scene.my.Centro;
        color = [0, 1, 0, scene.my.veloc]
    };

/Self_solve_the_maze/scene.phn

postStep := (e)=>{
        _move = scene.my.direzione;
        _move == _direzione ? {
            color = [1.0000000, 0.0000000, 0.0000000, 1.0000000]
        } : {
            color = [1.0000000, 0.0000000, 0.0000000, 0]
        }
    };

/Self_solve_the_maze/scene.phn

postStep := (e)=>{
        _letture;
        _VEDI_PARETI;
        _11sendMove1;
        _11sendMoveCurve;
        _11sendMoveT;
        _11sendMove_corridoio1;
        _11sendMove_corridoio2;
        _11sendMoveNul1;
        _11sendMoveNul2;
        _11sendMoveNul3;
        _11sendMoveNul4;
        scene.my.pass = _perGiaPassato
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        pos = [scene.my.pos0, scene.my.pos1];
        q = sim.time;
        angle = q * 4
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.r * 4;
        w = math.sin(sim.time);
        colorHSVA = [36.923851 + w * q, 1.0000000, 0.44999999, 1.0000000]
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.r;
        w = math.sin(sim.time);
        a = scene.my.ang;
        s = scene.my.av;
        k = q * a * s * 200;
        colorHSVA = [268.13959 + k, 1.0000000, 1.0000000, 1.0000000]
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.r;
        color = [0.0000000, 0.0000000, 0.25999999 + (q / 5), 1.0000000]
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        pos = [scene.my.pos0, scene.my.pos1];
        angle = scene.my.ang;
        a = scene.my.av;
        color = [1.0000000, 1.0000000, 1.0000000, 0 - a * 10]
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        x = scene.my.pos0;
        y = scene.my.pos1;
        a = scene.my.ang;
        pos = [(x / 8) + 56, y / 8];
        angle = a
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        pos = scene.my.q2;
        angle = scene.my.a2
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = sim.time * 100;
        colorHSVA = [q, 1.0000000, 1.0000000, 0.69999999]
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = sim.time;
        rotation = q * 4
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
                scene.my.p = pos
            };
            opaqueBorders := true;
            geomID := 11223;
            body := 0;
            edgeBlur := 0.0099999998;
            angle := -0.85762119;
            timeToLive := 50;
            zDepth := 7.0000000;
            layer := 0
        })
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.r * 4;
        w = math.sin(sim.time / 2.2000000);
        colorHSVA = [145 + w * q, 1.0000000, 0.40000001, 1.0000000]
    };

/Robot_with_radar_avoids_moving_obstacles/scene.phn

postStep := (e)=>{
        scene.my.q2 = pos;
        scene.my.a2 = angle
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        vel = (scene.my.player - pos + [0, 0.69999999]) * 7;
        scene.my.luce < 0 || scene.my.win1 == 1 ? {
            timetolive = 0
        } : {};
        scene.my.punti = pos
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        pos = scene.my.punti + [-0.055000000, -0.059999999];
        scene.my.win1 == 1 || scene.my.luce < 0 ? {
            timetolive = 0
        } : {}
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        vel = (scene.my.player - pos) * 20;
        scene.my.end > 0 ? {
            timetolive = 0
        } : {}
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        scene.my.win1 == 1 ? {
            collideset = 0;
            vel = ([8, 2.5000000] - pos) * 6
        } : {}
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        colorhsva = [rand.normal * 300, 0.50000000, 1.0000000, 1.0000000];
        vel = (scene.my.pCr - pos) * 1
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        scene.my.luce < 0 || scene.my.expl == 1 ? {
            timetolive = 0
        } : {};
        scene.my.pmove = pos
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        scene.my.expl == 1 ? {
            _t = _t - 0.0099999998
        } : {};
        pos = scene.my.psche + [0, 0.25000000];
        colorhsva = [60.000000, 1.0000000, 1.0000000, _t + 0.38000000 + (rand.uniform01 * 0.33000001)]
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        scene.my.win1 == 1 ? {
            timetolive = 0
        } : {};
        _t = _t + 1 + (1 - rand.uniform01);
        _t > 153 ? {
            _cambio = 1;
            _t = 0
        } : {};
        _cambio == 1 ? {
            _r = rand.uniform01;
            _cambio = 0
        } : {};
        _dirRand;
        vel = _dir;
        scene.my.fantasma = pos
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        pos = scene.my.player;
        Xpallona = my.scene.Xpallona;
        Xpallina = my.scene.Xpallina;
        Xpallina = pos(0);
        Ypallina = pos(1);
        XX = Xpallina - Xpallona;
        YY = Ypallina - Ypallona;
        angolo = math.atan(YY / XX);
        my.scene.angolo = angolo;
        my.scene.Xpallina = pos(0);
        my.scene.Ypallina = pos(1)
    };

/LUMEN_working_videogame/scene.phn

postStep := (e)=>{
        colorhsva = [240.00000, 1.0000000, 0.33333334, 1.0000000 - scene.my.ef]
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        vel = (scene.my.pos - pos + [0, 8]) * 2;
        q = scene.my.mcolor;
        colorHSVA = [q, colorHSVA(1), colorHSVA(2), colorHSVA(3)]
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        vel = (scene.my.pos - pos) * 100
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        q = scene.my.mcolor;
        colorHSVA = [q, colorHSVA(1), colorHSVA(2), colorHSVA(3)]
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        q = scene.my.fri;
        q == 1 ? {
            collideSet = 2
        } : {
            collideSet = 0
        }
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.anvel = angle * 7
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.pos = pos;
        scene.my.ang = angle
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        angle > 1.3000000 ? {
            color = [1, 0, 1, 1]
        } : {};
        angle < (-0.89999998) ? {
            color = [0, 0, 1, 1]
        } : {};
        scene.my.c1 = color;
        scene.my.angle = angle
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.mimetic1 = colorHSVA(0)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.mimetic6 = colorHSVA(0)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.mimetic5 = colorHSVA(0)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.mimetic4 = colorHSVA(0)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.mimetic3 = colorHSVA(0)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        scene.my.mimetic2 = colorHSVA(0)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        c1 = scene.my.mimetic1;
        c2 = scene.my.mimetic2;
        c3 = scene.my.mimetic3;
        c4 = scene.my.mimetic4;
        c5 = scene.my.mimetic5;
        c6 = scene.my.mimetic6;
        _colorTot = (c1 + c2 + c3 + c4 + c5 + c6) / 6;
        q = _colorTot - pos(1);
        vel = [0, q * 7];
        scene.my.mcolor = pos(1)
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        motorSpeed = scene.my.anvel
    };

/Octopus_mimetization/scene.phn

postStep := (e)=>{
        a = scene.my.ang2;
        k = (a - 1.3000000) * 10;
        k1 = (a + 1.3000000) * 4;
        c = scene.my.c1;
        c == [1, 0, 1, 1] ? {
            motorSpeed = k
        } : {
            motorSpeed = k1
        }
    };

/virus_scripted/scene.phn

postStep := (e)=>{
        pos = scene.my.pos + [(-0.039999999), 0.60000002]
    };

/Beyblade/scene.phn

postStep := (e)=>{
        r = sin(rand.uniform01);
        color = [0.50000000, 0.0000000, 0.0000000, r]
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _pan = scene.camera.pan;
        pos = _pan
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _kk = _kk - 0.0099999998;
        _kk < 0 ? {_kk = 0} : {};
        colorHSVA = [0.0000000, _kk, 1.0000000, 1];
        _pan = scene.camera.pan;
        pos = _pan
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _pan = scene.camera.pan;
        pos = _pan + _pp
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _pan = scene.camera.pan;
        pos = _pan + _pp;
        color = [1.0000000, 0.64499998, 0.29000002, _k]
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _pan = scene.camera.pan;
        pos = _pan + _pp;
        color = [0.73534560, 1.0000000, 0.13999999, _k]
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        scene.camera.pan = [_scroll, 0];
        scene.camera.zoom = 150;
        _scroll < (-5) ? {
            _scroll = (-5)
        } : {};
        _scroll > 195 ? {
            _scroll = 195
        } : {}
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _t = _t - 0.0070000002;
        color = [0, 0, 0, _t];
        color(3) < 0 ? {
            timeToLive = 0
        } : {}
    };

/mechanism_various_script_interface/scene.phn

postStep := (e)=>{
        _kk = _kk - 0.020000000;
        _kk < 0 ? {_kk = 0} : {};
        colorHSVA = [0.0000000, 0, 0.0000000, _kk];
        _pan = scene.camera.pan;
        pos = _pan
    };

/SCRIPT_COLLECTION_2/scene.phn

postStep := (e)=>{
        Refractiveindex = 39.000000 - 44.000000 * math.sin(sim.time)
    };

/SCRIPT_COLLECTION_2/scene.phn

postStep := (e)=>{
        radius = 0.20000000 + 0.029999999 * math.sin(sim.time * 10)
    };

/SCRIPT_COLLECTION_2/scene.phn

postStep := (e)=>{
                rotation = 0.0000000 - 0.69999999 * math.sin(sim.time)
            };
            onLaserHit := (e)=>{};
            collideSet := 1023;
            onKey := (e)=>{};
            colorHSVA := [60.000000, 1.0000000, 1.0000000, 0.0000000];
            layer := 0
        })
    };

/SCRIPT_COLLECTION_2/scene.phn

postStep := (e)=>{
        rotation = 10.000000 - 0.69999999 * math.sin(sim.time * 3)
    };

/SCRIPT_COLLECTION_2/scene.phn

postStep := (e)=>{
        length = 1.6000000 + 1.0000000 * math.sin(sim.time * 6);
        size = 0.60000002 + 2.0000000 * math.sin(sim.time * 6)
    };

/SCRIPT_COLLECTION_2/scene.phn

postStep := (e)=>{
        length = 3.0000000 + 1.7000000 * math.sin(sim.time)
    };

/STOPlight/scene.phn

postStep := (e)=>{
        scene.my.red = _timeRED;
        scene.my.yellow = _timeYELLOW;
        scene.my.green = _timeGREEN
    };

/Kaleidoscopic_screensaver/scene.phn

postStep := (e)=>{
        color = my.scene.c107
    };

/Smart_bacterium_avoids_obstacles/scene.phn

postStep := (e)=>{
        scene.my.ang = angle;
        scene.my.pos = pos
    };

/Smart_bacterium_avoids_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.S1;
        w = scene.my.S2;
        t = math.sin(sim.time);
        q = (q * (-1)) + 1.5000000;
        q < 0 ? {q = 0} : {};
        w = (w * (-1)) + 1.5000000;
        w < 0 ? {w = 0} : {};
        a = (w - q) * 3;
        angle = a + scene.my.ang + t / 3;
        scene.my.q = angle
    };

/Smart_bacterium_avoids_obstacles/scene.phn

postStep := (e)=>{
        pos = scene.my.pos
    };

/Smart_bacterium_avoids_obstacles/scene.phn

postStep := (e)=>{
        q = math.sin(sim.time * 5) * 0.10000000;
        angle =  - q + scene.my.ang
    };

/Smart_bacterium_avoids_obstacles/scene.phn

postStep := (e)=>{
        q = scene.my.S1;
        q = (q * (-1)) + 1.5000000;
        q < 0 ? {q = 0} : {};
        force = q * 60
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        scene.my.base = pos
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        vel = (((scene.my.braccio + scene.my.base + scene.my.palla) / 2) - pos) * 6
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        scene.my.palla = pos;
        vel = (Scene.my.pinza - pos) * 10;
        pos(0) < scene.my.girati ? {
            _angscanner = 1.5707964
        } : {
            _angscanner = (-1.5707964)
        };
        angvel = (_angscanner - angle) * 9
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        _apri0Chiudi1 == 0 ? {
            collideset = 0;
            colorhsva = [120.00000, 1.0000000, 1.0000000, 1.0000000]
        } : {
            collideset = 1;
            colorhsva = [0, 1.0000000, 1.0000000, 1.0000000]
        }
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        _pX = (pos(0) - _p(0));
        _pY = (pos(1) - _p(1));
        texturematrix = [1.2305282, 0.0000000, 0.49999976 + (_pX * 1.2300000), 0.0000000, 0.49996936, 0.93750346 + (_pY * 0.50000000), 0.0000000, 0.0000000, 0.99999958]
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        _mov > 0.10000000 ? {_t = 2} : {};
        _t = _t - 0.0099999998;
        color = [1.0000000, 1.0000000, 1.0000000, _t]
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        _t = _t + 1 + (1 + rand.uniform01);
        _t > 300 ? {
            pos = scene.my.Pscanner;
            _t = 0
        } : {};
        scene.my.p3 = pos
    };

/Scaner_anatomy/scene.phn

postStep := (e)=>{
        scene.my.Pscanner = pos
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        my.scene.a = angVel
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        a = my.scene.p;
        pos = [2.8000000, a * 2]
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        my.scene.p1 = pos(1);
        my.scene.p2 = pos(0)
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        pos = [pos(0), -0.36607003]
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        a = a + 0.20000000;
        radius = 0.0099999998 + a
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        q = math.sin(sim.time);
        a = q * 17;
        colorHSVA = [50.000000 - a, 1.0000000, 0.77999997, 1.0000000]
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        q = math.sin(sim.time);
        a = q * 17;
        colorHSVA = [50.000000 - a, 0.20000000, 0.50000000, 1.0000000]
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

postStep := (e)=>{
        scene.my.tpNo6 = pos
    };

/script_COLLECTION/scene.phn

postStep := (e)=>{
        scene.my.tpNo7 = pos + [0, 0]
    };

/Toys_for_kids/scene.phn

postStep := (e)=>{
        scene.my.tpNo7 = pos + [0, 0]
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        my.scene.angle = angle;
        my.scene.posRet = pos(0)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        q = (my.scene.posb - pos(0)) * 1;
        w = my.scene.velb / 2;
        d = (w + q) * (1);
        angle = (d / 10)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        my.scene.rad = {
            a = my.scene.angvelc * 20;
            s = my.scene.anglec * 10;
            q = (my.scene.posc - my.scene.posRetc) * 1;
            r = (q - s) * 2;
            w = my.scene.velc * 10;
            d = (w + r - a)
        };
        my.scene.radius = my.scene.rad / 20
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        my.scene.posb = pos(0);
        my.scene.velb = vel(0)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        radius = 0.25000000 + my.scene.radius
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        my.scene.pos = pos(0);
        my.scene.vel = vel(0)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        radius = 0.25000000 + my.scene.radius * (-1)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        my.scene.posc = pos(0);
        my.scene.velc = vel(0)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        my.scene.radd = {
            a = my.scene.angveld * 0;
            s = my.scene.angled * 2;
            q = (my.scene.posd - my.scene.posRetd) * 1;
            r = (q - s) * 2;
            w = my.scene.veld * 10;
            d = (w + r - a)
        };
        my.scene.length = (my.scene.radd / 10) * (-1)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        s = my.scene.angle * 10;
        q = (my.scene.pos - my.scene.posRet) * 1;
        r = (q - s) * 10;
        w = my.scene.vel * 10;
        d = (w + r) * (-1);
        motorSpeed = (d)
    };

/balance_ball_script/scene.phn

postStep := (e)=>{
        length = 1.7677670 + my.scene.length
    };

/elettric_bell_mechanism/scene.phn

postStep := (e)=>{
        _q = _q - 0.0010000000;
        _q < 0 ? {_q = 0} : {};
        _q > 1 ? {_q = 1} : {};
        pos = [_r1, _r2] * [_q, _q]
    };

/elettric_bell_mechanism/scene.phn

postStep := (e)=>{
        scene.my.onoff = _on;
        _onoff == 1 ? {
            collideSet = 3
        } : {
            collideSet = 1
        }
    };

/Vault_76_Fallout_door_animation/scene.phn

postStep := (e)=>{
        color = [1, 1, 1, 1 - (scene.my.level * 5)]
    };

/Vault_76_Fallout_door_animation/scene.phn

postStep := (e)=>{
        _leva = scene.my.leva;
        _leva > 1.4000000 ? {
            _pX = 1.4177366
        } : {
            _pX = 2.4529757
        };
        vel = ([_pX, 1.4059985] - pos) * [1, 20];
        scene.my.Pdoor = pos
    };

/Vault_76_Fallout_door_animation/scene.phn

postStep := (e)=>{
        _pdoor = scene.my.Pdoor;
        vel = (_pdoor - pos - [0, 1.4059985]) * [10, 2];
        _level = pos(1) + 0.078226835;
        _level < 0 ? {
            _level = 0
        } : {};
        scene.my.level = _level
    };

update

Set object text with a variable

(e)=>{
    text = {
        "x: " + Scene.my.cpos(0) + "\n" + "y: " + Scene.my.cpos(1)
    }
}

/LUMEN_working_videogame/scene.phn

update := (e)=>{
        App.GUI.playMode = sim.running
    };

/Quadruplicate_image_pixel_trick/scene.phn

update := (e)=>{
        keys.isDown("2") ? {
            e.this.color = [1, 1, 1, 1]
        } : {
            e.this.color = [1, 1, 1, 0]
        }
    };

/SCRIPT_COLLECTION_2/scene.phn

update := (e)=>{
        attraction = 0.10000000 + 3.0999999 * math.sin(sim.time);
        color = 1.0000000 + 1.1000000 * math.sin(sim.time)
    };

/SCRIPT_COLLECTION_2/scene.phn

update := (e)=>{
        motorspeed = 3.0999999 + 11.100000 * math.sin(sim.time)
    };

onCollide

/Convective_motion_fluid_particle_simulator/scene.phn

onCollide := (e)=>{
        e.other.density = 0.00079999998
    };

/primitive_adder_of_numbers_up_to_5_digits/scene.phn

onCollide := (e)=>{
        e.other.pos = [-4.4058409, 9.0216341];
        my.scene.score2 = my.scene.score2 + 1;
        my.scene.hits = 0
    };

/self_equilibrium/scene.phn

onCollide := (e)=>{
        e.other.pos = scene.my.tpNo0;
        e.other.vel = [0, 0]
    };

/armed_robot_mission_3/scene.phn

onCollide := (e)=>{
        e.other.pos = scene.my.tpNo0;
        e.other.vel = [0, 0]
    };

/Plasma_cannon/scene.phn

onCollide := (e)=>{
        _q = 1;
        timeToLive = 0.10000000
    };

/Magic_shield/scene.phn

onCollide := (e)=>{
        e.other._v = 1
    };

/stable_and_jumping_vehicle_robot_crawler_armed_with_laser_AND_ACID/scene.phn

onCollide := (e)=>{
                e.other.color = e.this.color;
                e.other.density = 1
            };
            density := 26.000000;
            radius := 0.11000000;
            edgeBlur := 1.0000000
        })
    };

/Pong_playtig_alone_NO_human_control/scene.phn

onCollide := (e)=>{
        e.other.pos = [0.0000000, 4.0000000];
        e.other.vel = [0, 20]
    };

/Brachistochrone_curve_with_timer/scene.phn

onCollide := (e)=>{
        e.other.materialname == "stop" ? {
            postStep = 0
        } : {}
    };

/SAFE_MECHANICAL_DISC_COMBINATION/scene.phn

onCollide := (e)=>{
        scene.camera.zoom = 55.500000
    };

/Display_4_FRAMES_ANIMATIONS_DISC_LOADING_SYSTEM/scene.phn

onCollide := (e)=>{
        e.other.color = e.this.color;
        e.other.density = 0.0010000000
    };

/ECO_localization/scene.phn

onCollide := (e)=>{
        e.other.materialName == "eco" ? {
            _yes = _yes + 1
        } : {}
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

onCollide := (e)=>{
        e.other.materialname == "on" ? {
            _onoff = 1
        } : {};
        e.other.materialname == "off" ? {
            _onoff = 0
        } : {}
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

onCollide := (e)=>{
        e.other.materialname == "friOn" ? {_fri = 1} : {};
        e.other.materialname == "friOff" ? {_fri = 0} : {}
    };

/Octopus_mimetization/scene.phn

onCollide := (e)=>{
        e.other.materialname == "friOn" ? {_fri = 1} : {};
        e.other.materialname == "friOff" ? {_fri = 0} : {}
    };

/Crowler_with_engine_accelerator_gearbox_and_clutch/scene.phn

onCollide := (e)=>{
        e.other.materialname == "smokeOn" ? {
            _smoke = 1
        } : {};
        e.other.materialname == "smokeOff" ? {
            _smoke = 0
        } : {}
    };

/armed_robot_mission_1/scene.phn

onCollide := (e)=>{
        scene.camera.zoom = 11.000000
    };

/armed_robot_mission_1/scene.phn

onCollide := (e)=>{
        sim.running = false
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        sim.running = false
    };

/armed_robot_mission_2/scene.phn

onCollide := (e)=>{
        sim.running = false
    };

/Air_conditioner_simulator_script/scene.phn

onCollide := (e)=>{
        e.other.density = 0.0099999998
    };

/TESLA_VALVE_playing_an_idea_of_nikola_teslapluscounter/scene.phn

onCollide := (e)=>{
        e.other.pos = [-4.4058409, 9.0216341];
        my.scene.score = my.scene.score + 1;
        my.scene.hits = 0
    };

/Snake_Nokya_working_script/scene.phn

onCollide := (e)=>{
        e.other._segmentiN = e.other._segmentiN + 1;
        timetolive = 0
    };

/Snake_Nokya_working_script/scene.phn

onCollide := (e)=>{
        e.other.materialname == "end" ? {_end = 1} : {}
    };

/Self_solve_the_maze/scene.phn

onCollide := (e)=>{
        _barrier = 1
    };

/LUMEN_working_videogame/scene.phn

onCollide := (e)=>{
        e.other.materialname == "scheletro" ? {
            _morte0o1 = 1;
            scene.my.expl = 1
        } : {}
    };

/LUMEN_working_videogame/scene.phn

onCollide := (e)=>{
        e.other.materialname == "q" ? {
            collideset = 0;
            _end = 1;
            scene.my.luce = scene.my.luce + 0.67000002
        } : {}
    };

/LUMEN_working_videogame/scene.phn

onCollide := (e)=>{
        _cambio = 1
    };

/Octopus_mimetization/scene.phn

onCollide := (e)=>{
        colorHSVA = e.other.colorHSVA
    };

/virus_scripted/scene.phn

onCollide := (e)=>{
        e.other.materialName == "virus" ? {
            _inff = 1;
            timeToLive = 0.0099999998
        } : {}
    };

/engine_gearbox_and_clutch_mechanism/scene.phn

onCollide := (e)=>{
        scene.addCircle({
            radius := 0.14000000;
            density := 27.000000;
            restitution := 0.50000000;
            friction := 0.050000001;
            color := [0.89995694, 0.59997129, 0.0000000, 1.0000000];
            pos := e.pos;
            collideSet := 3;
            drawCake := false;
            edgeBlur := 0.18000001
        })
    };

/SCRIPT_COLLECTION_2/scene.phn

onCollide := (e)=>{
        e.other.color = e.this.color;
        e.other.COLLIDESET = 5
    };

/SCRIPT_COLLECTION_2/scene.phn

onCollide := (e)=>{
        Scene.addWater({
            vecs = [e.pos]
        });
        e.other.text = "Hit The Water Spawner"
    };

/Laser_counter_no_collision/scene.phn

onCollide := (e)=>{
        my.scene.hits = my.scene.hits + 1;
        e.other.pos = [-3.8449609, 1.9727136]
    };

/Laser_counter_with_1_laser/scene.phn

onCollide := (e)=>{
        my.scene.hits = my.scene.hits + 1;
        e.other.pos = [-3.8449609, 1.9727136]
    };

/OLD_WRITING_MACHINE/scene.phn

onCollide := (e)=>{
        e.other.color = e.this.color
    };

/infinite_landscape_desert_auto_driving_jeep/scene.phn

onCollide := (e)=>{
        e.other.pos = scene.my.tpNo6;
        e.other.vel = [0, 0];
        e.other.color = e.this.color
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        scene.camera.zoom = 21.500000
    };

/armed_robot_mission_2/scene.phn

onCollide := (e)=>{
        scene.camera.zoom = 21.500000
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        my.scene.hits = my.scene.hits + 1
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        e.other.pos = [-0.66366851, -0.78284615];
        my.scene.score = my.scene.score + 1;
        my.scene.hits = 0
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        e.other.pos = scene.my.tpNo7;
        e.other.vel = [0, 0]
    };

/Toys_for_kids/scene.phn

onCollide := (e)=>{
        e.other.pos = scene.my.tpNo7;
        e.other.vel = [0, 0]
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        e.other.color = e.this.color;
        e.other.density = 1
    };

/script_COLLECTION/scene.phn

onCollide := (e)=>{
        e.other.color = e.this.color;
        e.other.density = 0.0010000000;
        e.other.radius = 0.064999998;
        e.other.edgeblur = 0
    };

/armed_robot_mission_3/scene.phn

onCollide := (e)=>{
        scene.camera.zoom = 14.700000
    };

/armed_robot_mission_3/scene.phn

onCollide := (e)=>{
        scene.camera.zoom = 6.6999998
    };

/PSYCHEDELIC_LASER_PINBALL_plus_SCORE_COUNTER/scene.phn

onCollide := (e)=>{
        my.scene.score = my.scene.score + 1;
        my.scene.hits = 0
    };

/elettric_bell_mechanism/scene.phn

onCollide := (e)=>{
        _q = _q + 0.10000000
    };

/elettric_bell_mechanism/scene.phn

onCollide := (e)=>{
        e.other.materialName == "on" ? {_on = 1} : {};
        e.other.materialName == "off" ? {_on = 0} : {}
    };

onSpawn

/primitive_adder_of_numbers_up_to_5_digits/scene.phn

onSpawn := (e)=>{
        my.scene.hits = 0
    };

/Automatic_scripted_pinball_no_human_control/scene.phn

onSpawn := (e)=>{
        my.scene.hits = 0
    };

/Beyblade/scene.phn

onSpawn := (e)=>{
        my.scene.hits = 0
    };

/Laser_counter_no_collision/scene.phn

onSpawn := (e)=>{
        my.scene.hits = 0
    };

/Pong_playtig_alone_NO_human_control/scene.phn

onSpawn := (e)=>{
        my.scene.score = 0
    };

/script_COLLECTION/scene.phn

onSpawn := (e)=>{
        my.scene.score = 0
    };

/PSYCHEDELIC_LASER_PINBALL_plus_SCORE_COUNTER/scene.phn

onSpawn := (e)=>{
        my.scene.score = 0
    };

/orbits2/scene.phn

onSpawn := (e)=>{
        Scene.my.last_fire = 0
    };

/Laser_counter_with_1_laser/scene.phn

onSpawn := (e)=>{
        my.scene.hits3 = 0
    };

onKey

Smooth-move an object to the cursor when a key is held

(e)=>{
    keys.isDown("1") ? {
        e.this.color = [0.2, 0.4, 0.6, 1];
        e.this.pos = lerp(pos, App.mousePos, 0.15)
    } : {
        e.this.color = [1, 1, 1, 0]
    }
}

/Catching_puppets_crane/scene.phn

onKey := (e)=>{
        keys.isDown("return") ? {
            _start = 1
        } : {}
    };

/Plasma_cannon/scene.phn

onKey := (e)=>{
        keys.isDown("v") ? {_fire} : {};
        keys.isDown("b") ? {_firen} : {}
    };

/LUMEN_working_videogame/scene.phn

onKey := (e)=>{
        keys.isDown("w") ? {_dir = 0} : {};
        keys.isDown("d") ? {_dir = 1} : {};
        keys.isDown("a") ? {_dir = 2} : {};
        keys.isDown("s") ? {_dir = 3} : {}
    };

/mechanism_various_script_interface/scene.phn

onKey := (e)=>{
        keys.isDown("return") ? {_kk = 1} : {};
        keys.isDown("backspace") ? {_kk = 1} : {}
    };

/mechanism_various_script_interface/scene.phn

onKey := (e)=>{
        keys.isDown("backspace") ? {_k = 1} : {_k = 0}
    };

/mechanism_various_script_interface/scene.phn

onKey := (e)=>{
        keys.isDown("return") ? {_k = 1} : {_k = 0}
    };

/mechanism_various_script_interface/scene.phn

onKey := (e)=>{
        keys.isDown("return") ? {
            _scroll = _scroll + 5
        } : {};
        keys.isDown("backspace") ? {
            _scroll = _scroll - 5
        } : {}
    };

/mechanism_various_script_interface/scene.phn

onKey := (e)=>{
        keys.isDown("return") ? {
            _kk = 1.5000000
        } : {};
        keys.isDown("backspace") ? {
            _kk = 1.5000000
        } : {}
    };
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment