I have a pretty good pattern AI working right now and I just finished up the last part for my last enemy. What the patter code does is it makes the enemy move left or right and then shoot when I want them to. I have been using the same struture (and sometimes code) for all of the other ememies and they have worked fine but this one has a problem. It won''t fire the weapon, I tested to see if it was preforming the drawing function and it is, then I tested to see if it was performing the firing function and it was (well I already knew that because it was playing the firing sound). I double checked that I was doing everything the same way as I was doing it before and I was. So now I am completely clueless why this is happening. Im pretty sure that its in the actual gun''s code not the AI so here is that code (this code is almost the exact same as all my other gun''s code that works find):
void Init_Bosscannon(void)
{
Load_Bitmap_File(&bitmap16bit, "BOSSMSL.BMP&quot;
#if 1
for (int msl=0; msl<MAX_BOSSCANNON; msl++)
{
Create_BOB(&bosscannon[msl],0,0,4,8,2,
BOB_ATTR_VISIBLE / BOB_ATTR_MULTI_FRAME,
DDSCAPS_SYSTEMMEMORY);
for (int frame=0; frame<2; frame++)
Load_Frame_BOB(&bosscannon[msl],&bitmap16bit,frame,frame,0,BITMAP_EXTRACT_MODE_CELL);
Set_Anim_Speed_BOB(&bosscannon[msl],1);
bosscannon[msl].state = BOSSCANNON_STATE_OFF;
}
#endif
#if 0
Create_BOB(&bosscannon[0],0,0,4,8,2,
BOB_ATTR_VISIBLE / BOB_ATTR_MULTI_FRAME,
DDSCAPS_SYSTEMMEMORY);
for (int frame=0; frame<2; frame++)
Load_Frame_BOB(&bosscannon[0],&bitmap16bit,frame,frame,0,BITMAP_EXTRACT_MODE_CELL);
Set_Anim_Speed_BOB(&bosscannon[0],1);
bosscannon[0].state = BOSSCANNON_STATE_OFF;
for (int msl=1; msl<MAX_BOSSCANNON; msl++)
{
memcpy(&bosscannon[msl], &bosscannon[0], sizeof(BOB));
}
#endif
Unload_Bitmap_File(&bitmap16bit);
}
void Delete_Bosscannon(void)
{
for (int index=0; index<MAX_BOSSCANNON; index++)
Destroy_BOB(&bosscannon[index]);
}
void Move_Bosscannon(void)
{
for (int index=0; index<MAX_BOSSCANNON; index++)
{
if (bosscannon[index].state == BOSSCANNON_STATE_ON)
{
Move_BOB(&bosscannon[index]);
if (bosscannon[index].y > 600 )
{
bosscannon[index].state = BOSSCANNON_STATE_OFF;
continue;
}
}
}
for (index=0; index<MAX_BOSSCANNON; index++)
{
if ((bosscannon[index].attr & BOB_ATTR_VISIBLE) && (bosscannon[index].state == BOSSCANNON_STATE_ON)
&& (Collision_BOBS(&ship, &bosscannon[index]) ) )
{
bosscannon[index].state = BOSSCANNON_STATE_OFF;
counter2 = 0;
player_state = PLAYER_STATE_DYING;
}
}
}
void Draw_Bosscannon(void)
{
for (int index=0; index<MAX_BOSSCANNON; index++)
{
if (bosscannon[index].state == BOSSCANNON_STATE_ON)
{
Draw_BOB(&bosscannon[index],lpddsback);
Animate_BOB(&bosscannon[index]);
}
}
}
void Fire_Bosscannon(int x,int y, int vel)
{
if (bosson == 1 // boss2on == 1)
{
for (int index=0; index<MAX_BOSSCANNON; index++)
{
if (bosscannon[index].state == BOSSCANNON_STATE_OFF)
{
bosscannon[index].x = x;
bosscannon[index].y = y;
bosscannon[index].yv = vel;
bosscannon[index].curr_frame = 0;
bosscannon[index].state = BOSSCANNON_STATE_ON;
for (int sound_index=0; sound_index < MAX_FIRE_SOUNDS; sound_index++)
{
if (Status_Sound(fire_ids[sound_index])==0)
{
Play_Sound(fire_ids[sound_index]);
break;
}
}
return;
}
}
}
}
In Game_Init() I execute Init_Bosscannon, in Game_Main() I execute Move_Bosscannon and Draw_Bosscannon, and in Game_Shutdown I execute Delete_Bosscannon. Does anyone see any errors in this code above? If you think that the AI code will help I can post that up too.
Thanx,
ViPeR

Everything is correctly defined (if it wasn''t it would probably give me a compiler error which I am not getting) and Boss_AI() is executed in the Game_Main() function. I don''t really see the problem is this code at all but if anyone else does let me know.