How to generate an end screen when two images collide?

前端 未结 2 706
甜味超标
甜味超标 2021-01-26 15:15

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 16:07

    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

提交回复
热议问题