我有一個小型遊戲的圖像/角色。我可以讓他跳起來,左右走。我但我希望他能夠登陸其他圖像,如超級馬里奧登陸磚塊或塗鴉跳躍(沒有跳躍)。我如何做到這一點,所以一旦我的形象跳躍和摔倒,如果它着陸在另一幅圖像,它會停止。謝謝!圖像在其他圖像上停止
我跳碼:
[UIView animateWithDuration:.5 delay:0.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
CGRect f = imageView.frame;
f.origin.y -= 40;
imView.frame = f;
}
completion:^(BOOL finished){
[UIView animateWithDuration:.7 delay:0.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
CGRect f = imageView.frame;
f.origin.y += 40;
imView.frame = f;
}
completion:nil];
您使用的是cocos2d嗎?分享你當前的代碼將有所幫助。 – gmogames 2012-08-05 03:57:44
查找二維碰撞檢測...這就是你要找的。 – WendiKidd 2012-08-05 04:01:50