function sudden_light()
{
my.invisible = on;
my.passable = on;
my.cast = on;//damit werfen die modelle auch wegen dem licht schatten
my.light = on;
my.lightrange = 200; //light range
my.red = 5;
my.green = 5;
my.blue = 5;
}
action make_light
{
while (!player) {wait (1);}
while (1)
{
// if the player comes close to the object
if (vec_dist(player.x, my.x) < 80) // play with 100
{
if (key_space)
{
while (key_space) {wait(1);}
//
//wait (1);
// wait until the space key is released
sudden_light();
ent_remove (me);
}
}
wait (1);
}
}