이 GameViewController.mCGPathContainsPoint 질문이 있으십니까?
-(void)fillMutablePath{
CGPoint movePoint = CGPointFromString([pointsToFillArray objectAtIndex:0]);
CGPathMoveToPoint(fillPath, NULL, movePoint.x, movePoint.y);
for (int i=0; i<[pointsToFillArray count]; i++) {
CGPoint tempPoint = CGPointFromString([pointsToFillArray objectAtIndex:i]);
CGPathAddLineToPoint(fillPath, NULL, tempPoint.x, tempPoint.y);
CGContextAddPath(gameViewObj._myContext, fillPath);
CGContextFillPath(gameViewObj._myContext);
if(CGPathContainsPoint(fillPath, nil, "What goes here?", false)){
[self doDie];
}
else {
CGContextFillPath(gameViewObj._myContext);
}
CGPathRelease(fillPath);
[pointsToFillArray removeAllObjects];
}
}
에이 GameView.m에
-(CGPoint) GetBirdPosition:(CGPoint) PtPoint :(int) BirdNumber{
CGPoint Temp=PtPoint;
BOOL isTouch=TRUE;
while (isTouch)
{
isTouch=FALSE;
if(playField[(int) Temp.x][(int) Temp.y]==2)
{
isTouch=TRUE;
if(playField[(int) Temp.x+1][(int) Temp.y] == 2 || playField[(int) Temp.x-1][(int) Temp.y] == 2)
{
pos[BirdNumber].y = -pos[BirdNumber].y;
Temp.y+=pos[BirdNumber].y;
}
else if(playField[(int) Temp.x][(int) Temp.y+1] == 2 || playField[(int) Temp.x][(int) Temp.y-1] == 2)
{
pos[BirdNumber].x = -pos[BirdNumber].x;
Temp.x+=pos[BirdNumber].x;
}
}
}
return Temp;
}
-(void)flyingBird:(NSTimer *)timer {
if(appDelegate.gameStateRunning == YES){
for (int i=0; i< [birdImageViewArray count];i++)
{
UIImageView* birdImageView=[birdImageViewArray objectAtIndex:i];
CGPoint Temp=CGPointMake(birdImageView.center.x + pos[i].x , birdImageView.center.y + pos[i].y);
birdImageView.center =[self GetBirdPosition:Temp:i];
if(playField[(int) birdImageView.center.x][(int) birdImageView.center.y]==3){
[[NSNotificationCenter defaultCenter] postNotificationName:@"LineCrossed" object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"PlayDieSound" object:nil];
}
}
}
}
나는 "무슨 일이 간다"쓴 장소에가는 것을 알아낼 수 없습니다? 나는 새가 그 모양 안에 갇히게되면 [doDie]가 일어나기를 원합니다. 새가 모양 안에 갇혀 있지 않으면 채워집니다. 어떤 생각이라도 대단히 감사하겠습니다.
레벨에 따라 2-26 마리의 새가 날 수 있습니다. 그들 중 하나가 형성되는 모양 안에 포함되어 있다면, 나는 [doDie]가 일어나길 원합니다. 나를 미치게하고있어. 나는 내가 원하는 것을 정반대로 얻을 수있다. 새가 그 모양에 포함되어 있다면 그 부분이 색깔로 채워지지 않도록 내가 만든 방법을 알아낼 수 없습니다. 나는 너의 제안을 시도하고 내가 생각해내는 것을 보게 될 것이다. – NextRev
이 fillpath는 무엇입니까? 어디서나 동일한 질문에 대해 인터넷 검색을하는 동안 나는 그것을 그대로보고 있습니다. 설명 없음. –