How do I create collision detections for my bouncing balls?

后端 未结 7 1235
星月不相逢
星月不相逢 2021-02-04 18:13

I have coded an animation (in python) for three beach balls to bounce around a screen. I now wish to have them all collide and be able to bounce off each other. I would really a

7条回答
  •  野性不改
    2021-02-04 18:43

    Back in the good old times when CPU cycles were a premium coders used a simple trick to detect collision: they used such colours that they could tell from the pixel colour if it was background or an object. This was done on at least some C64 games.

    Don't know if you are willing to go this route, though..

提交回复
热议问题