Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void drawBullet()
- {
- do
- {
- for(int i=0; i<Bullet_No; i++) if(!bullet[i].alive)
- {
- bullet[i].alive = 1;
- bullet[i].b.x = player.x + 60 ;
- bullet[i].b.y = player.y + 30 ;
- break; // break this for( ) loop
- }
- drawBullet();
- for(int i=0; i<Bullet_No; i++) if(bullet[i].alive)
- {
- bullet[i].b.x += 5;
- bullet[i].b.w = bullet[i].w;
- bullet[i].b.h = bullet[i].h;
- SDL_FillRect(screen , &bullet[i].b , 0xFFFF66);
- // Bullet Destroy condition
- if(bullet[i].b.x > 380) bullet[i].alive = 0;
- }
- break;
- } while (fireBullet = true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement