How can I push boxes in a tunnel in spritekit?

I am working on a game for sprites. I can’t walk in the tunnel. There are 5 boxes at the tunnel, and they are on the same line. The water in the tunnel moves. A person can push boxes in any direction. If a man wanted to escape from the tunnel, he must use these boxes. Therefore, he must push out these boxes and insert them into the tunnel, as well as move the boxes at the speed of the water in the tunnel. And also, if one box is pushed into the tunnel, then a person can walk on the box, and also he can push another box on top of the previously placed box in the river, and only part of the box in the tunnel will be free from collision.

enter image description here

Hope this image explains what I'm trying to achieve.

+3
source
1

collisionBitMask kernelBody . , .

-1

All Articles