timeToLive := 2 / Sim.frequency is not enough time to eliminate all adjacent matching blocks on my PC. I find timeToLive := 10 / Sim.frequency much more reliable.
Resetting Algodooo did not help me, but I'll comment anyway. I tested it be making WHOLE board same color and activate one in bottom corner, it was working on 36%.
If you are in the comment section thinking about whining about the nodes still being on when you open a different scene, the reason they are still on is because you exited this scene without turning the nodes off. Reopen this scene and press the "Show Nodes" button twice to turn them off. Another way to do it is to reset Algodoo. The nodes will be turned off automatically if you stop this scene before exiting Algodoo.
I do have the equivalent of your suggestion in the scene, so the scene does hide vertices upon stopping. The problem is if the user quits the scene without stopping first and then runs a different scene.
Q: Why is it that only sometimes you can delete nodes, while most of the times it simply moves it so that it's as if it wasn't there?
A: Algodoo always has the final say as to where nodes gets placed. For example, you can define a box shaped polygon using only four points, but when Algodoo creates it Algodoo will add many more points.
Thanks. I was thinking of making a _onDesignClick function that is an onClick function that works when the simulation is not running. This is just one step along the way.
I tried the effect. It doesn't take many pieces to slow things down. If I convert the pieces to circles or squares then the response is much faster. I might be able to improve the efficiency of the pointInPoly function. I could consider the point is in a polygon if it's within the average distance between the polygon center and the surface points.
Q: When I click on the Exit button, the word "Exit" displays in the box, replacing the previous value. Is it supposed to do that?
A: Yes.
Q: But why it will display CANCEL when I press cancel?
A: Because that's what the code tells it to do.
Q: Shouldn't it just leave old input?
A: What it should or shouldn't do is up to you.
Here's the deal. The code injector puts the code in the box, but it doesn't do everything for you. You still need to code the _setResponse event. Maybe something like this:
_inputBoxIsVisible = false;
response == "Cancel" || response == "Exit" ? {}:{ textScale = 0.5; text = "Nobody cares that you have " + response + " teeth."};
I had it display "Cancel" and "Exit" just to show you that it returns the button that was pressed in those cases.
Opened a blank scene. Made a box. Opened color widget for box. Saved scene as test.phn. Opened test.phn with Notepad++ (WordPad also works). Copied widget code. Pasted code into box onClick event.
I never considered the spinning bullet, but since you mentioned it I noticed in the video that the center hit block rotates about the gun barrel axis. Another thing that is interesting about a spinning bullet is that spinning must reduce friction in the direction of penetration.