SHARE
TWEET

Untitled

a guest May 14th, 2013 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void drawBullet()
  2. {
  3.     do
  4.     {
  5.         for(int i=0; i<Bullet_No; i++) if(!bullet[i].alive)
  6.             {
  7.                 bullet[i].alive = 1;
  8.                 bullet[i].b.x = player.x + 60 ;
  9.                 bullet[i].b.y = player.y + 30 ;
  10.                 break; // break this for( ) loop
  11.             }
  12.         drawBullet();
  13.         for(int i=0; i<Bullet_No; i++) if(bullet[i].alive)
  14.             {
  15.                 bullet[i].b.x += 5;
  16.                 bullet[i].b.w = bullet[i].w;
  17.                 bullet[i].b.h = bullet[i].h;
  18.                 SDL_FillRect(screen , &bullet[i].b , 0xFFFF66);
  19.                 // Bullet Destroy condition
  20.                 if(bullet[i].b.x > 380) bullet[i].alive = 0;
  21.             }
  22.         break;
  23.     } while (fireBullet = true);
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top