How to generate an end screen when two images collide?

前端 未结 2 1542
遥遥无期
遥遥无期 2021-01-26 15:42

how to generate an end screen when two images collide. I am making an app with a stickman you move with a very sensitive acceremeter. SO if it hits these spikes, (UIImages) it w

2条回答
  •  情话喂你
    2021-01-26 15:58

    I'm sure you know the rect of the two images because you need to draw them so you can use

    bool CGRectIntersectsRect (
       CGRect rect1,
       CGRect rect2
    );
    

    It returns YES if the two rects have a shared point

提交回复
热议问题