Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. void UpdateBullets(int *numbullets, int *numrobots, int bvel) {
  2. int i, j;
  3. for(i = 0; i < *numbullets ; i ++) {
  4. gfx_TransparentSprite_NoClip(ball_bullet,bullet[i].x,bullet[i].y);
  5. for(j = 0; j < *numrobots; j ++) {
  6. if (gfx_CheckRectangleHotspot(bullet[i].x, bullet[i].y, ball_bullet_width, ball_bullet_height, robots[j].x, robots[j].y, robotL_width, robotL_height)){
  7.  
  8. }
  9. }
  10.  
  11. if (bullet[i].x + bullet[i].xdir * bvel > 0 && bullet[i].x + bullet[i].xdir * bvel < 320-8 &&
  12. bullet[i].y + bullet[i].ydir * bvel > 0 && bullet[i].y + bullet[i].ydir * bvel < 240-8) {
  13.  
  14. bullet[i].x += bullet[i].xdir * bvel;
  15. bullet[i].y += bullet[i].ydir * bvel;
  16.  
  17. } else {
  18.  
  19. bullet[i].x = bullet[*numbullets-1].x;
  20. bullet[i].y = bullet[*numbullets-1].y;
  21. bullet[i].xdir = bullet[*numbullets-1].xdir;
  22. bullet[i].ydir = bullet[*numbullets-1].ydir;
  23. *numbullets -= 1;
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement