Skip to content

Instantly share code, notes, and snippets.

@kw0006667
Created November 18, 2012 16:29
Show Gist options
  • Save kw0006667/4106098 to your computer and use it in GitHub Desktop.
Save kw0006667/4106098 to your computer and use it in GitHub Desktop.
sample6.cpp 2
for (int i = 0; i < NUM_TARGET; i++)
{
tempHead=head;
while(tempHead != NULL )//刪頭
{
if (tempHead->fby > 40 || enemy[i].Hitting(tempHead->fbx, tempHead->fby))
{
if(tempHead->next){
tempHead->next->prior = tempHead->prior;
}
else
{
tail = tempHead;
}
if(tempHead->prior){
tempHead->prior->next = tempHead->next;
}
else
{
head = tempHead;
}
free(tempHead);
count--;
if (tempHead->next != NULL)
tempHead = tempHead->next;
else
tempHead = NULL;
}
else
{
if (tempHead->next != NULL)
tempHead = tempHead->next;
else
tempHead = NULL;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment