Domino idea how to make physics hittest possible?

I like domino.. but how to make that in ZIM? example on this website Domino


the domino pics ar falling down and you can connect them after falling randomly.
any example that can help me?
Thanks

1 Like

Seems like it would be very easy to do with physics... but that would be in side view and then maybe switch to top view by setting gravity = 0 and maybe swapping the tiles from a side view to a top view.

you know how to do that.. from gravity falling to "no gravity" switching .. ? any zapp that can help me?

Just off to a Movie - seeing Dune. Will see if I can do a quick example later tonight.

1 Like
1 Like

cool! Thanks. I added all the number 0 1 2 3 4 5 6 (as you did some :slight_smile: :birthday: for your birthday the gesture version @abstract
I made this version of your code
with transform

with gesture

idea from this file Domino

Nice - I like the rotation snapping - that is better than pure physics. Sometimes when I drop it does not remove it - you should figure out why.

Can you disable physics on mouse down? Anyway to use regular drag Instead of physics.drag()? Physics drag isn't multi touch.

Could use ZIM drag and the new objWithPhysics.attach(objWithDragAndNoPhysics) mehod

can you make a video about the new physics.attach() to understand what it does? Thanks.

I was able to get it working but because of multi touch once I drag it no longer has physics so it doesn't interact with the other pieces, the ones on the "ground". Would this be solved with physics.attach()?

I think the @karelrosseel82 version does some fancy stuff to get the turning to work. Our original just stays in Physics and yes... I think attach() would allow multitouch

https://zimjs.com/valentines/puppets.html

https://zimjs.com/valentines/puppets2.html

Have a couple examples of attach - but only one attached... just try something similar with two draggable objects using attach()

Here is a demo and it works! Cool.

You read my mind. I was just going to work on something like this. Thanks!

I had figure it out and found that it had worked however the new challenge was that the "static" object doesn't allow the attached object to respond to physics. In the case of the dominoes they didn't fall once I attached the "static" object.

1 Like