PosX+=dGetSpriteWidth(szName)/2+1; fSpeedX=BULLET_SPEED; fSpeedY=0.f; break;?case2: fPosY+=dGetSpriteHeight(szName)/2+1; fSpeedX=0.f; fSpeedY=BULLET_SPEED; break;?case3: fPosX-=dGetSpriteWidth(szName)/2+1; fSpeedX=-BULLET_SPEED; fSpeedY=0.f; break;?}?dSetSpritePosition(szBullet,fPosX,fPosY);?dSetSpriteRotation(szBullet,iDir*90.f);?dSetSpriteLinearVelocity(szBullet,fSpeedX,fSpeedY);?weaponPtrpBullet=(weapon*)malloc(sizeof(weapon));?pBullet->iDir=iDir;?sprintf(pBullet->szName,szBullet);?pBullet->fPosX=fPosX;?pBullet->fPosY=fPosY;?pBullet->fSpeedX=fSpeedX;?pBullet->fSpeedY=fSpeedY;?pBullet->iType=iType;?pBullet->iHp=1;?AddToList(pBullet);}子弹与其他精灵碰撞voidOnBulletColOther(constchar*szBulletName,constchar*szOtherName){?weaponPtrpBullet=FindNode(szBulletName);?if(pBullet!=NULL)?{ pBullet->iHp=0;?}}