Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void UpdateBullets(int *numbullets, int *numrobots, int bvel) {
- int i, j;
- for(i = 0; i < *numbullets ; i ++) {
- gfx_TransparentSprite_NoClip(ball_bullet,bullet[i].x,bullet[i].y);
- for(j = 0; j < *numrobots; j ++) {
- 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)){
- }
- }
- if (bullet[i].x + bullet[i].xdir * bvel > 0 && bullet[i].x + bullet[i].xdir * bvel < 320-8 &&
- bullet[i].y + bullet[i].ydir * bvel > 0 && bullet[i].y + bullet[i].ydir * bvel < 240-8) {
- bullet[i].x += bullet[i].xdir * bvel;
- bullet[i].y += bullet[i].ydir * bvel;
- } else {
- bullet[i].x = bullet[*numbullets-1].x;
- bullet[i].y = bullet[*numbullets-1].y;
- bullet[i].xdir = bullet[*numbullets-1].xdir;
- bullet[i].ydir = bullet[*numbullets-1].ydir;
- *numbullets -= 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement