Browse Search Popular Register Upload Rules User list Login:
Search:
Very good.

As there are many repeatable things, I guess you can simplify it by adding a function

AddBox := (map,box_color)=> {Scene.addBox({
size := e.geom._size;
pos := [3.25 + 1 + j * e.geom._size(0), 0.75 + 1 + i * e.geom._size(1)];
color := box_color;
drawBorder := true;
glued := true;
collideSet := 1;
body := 0;
layer := 1;
_slot := j + i * e.geom._slotY;
buttonDestroy := "w";
Scene.my.mapG = map ++ [pos]
})}

and use AddBox(Scene.my.mapG,[0.0, 0.3, 0, 1.0]) instead of this /\ :tup:
Awesome, I love mechanical stuff. :)
Just a little comment on the script if you want to know/do more:

"my_box := Scene.entityByGeomID((readable(entity)).geom); "

will get the geometry the laser is attached to. With this you can edit every property of the attached geometry, for example:

"my_box.friction = 0.0;"

will make the box frictionless.

This is the main part:

_Hit ? {
my_box.CollideSet = 4
} : {
my_box.CollideSet = 0
}

It checks if the laser is hitting any target and everything that you put inside the first braces will be executed if the laser is hitting, and everything inside the last braces will executed otherwise.

CollideSet numbers works as follows: A is 1, B is 2, C is 4, and so on... Any combination of them is just the unique sum of these powers of two, [A,B] is 3, [B,C] is 6, and so on
Last edited at 2016/07/30 04:37:15 by carl00s01
You forgot to turn the collideSet to 0 whenever it isn't hitting anything...
That was my problem: there is no "onLaserNotHit" function that is overridden by the "onLaserHit" one:P , but if you put the default case (_Hit = false) inside the update() it will work.
Have you considered doing a timelapse of your creations? I think it would be cool to see the complexity rising
That's not accurate. All three that you created would fall into the category of a solid. I added a scene response to show you how it should've been
Your scene shines in very slow motion and with gravity field visible. Good Work:tup:
Thanks for your input. Your approach is more like a really viscous liquid.
Here is where you add a response scene.
awesome as usual :tup:
That's nice, Luezma
previous | 1 2 3 | next