- I'm creating a pygame that involves 2 tanks shooting at each other
and a bullet. I've managed to create the bullet and get it to move,
but I'm not sure how to create a new instance of a bullet everytime I
press the keybutton. Currently, the bullet is just resetting every
time I press the key, but I want it to shoot a new bullet instead.
Currently, I've set SHOO and shoot as False, and the x and y
coordinates are for the bullet.
if keys[pygame.K_RSHIFT]:
SHOO = True
x2 = x1 + 30
y2 = y1 + 39
if SHOO and x1 >= -1000:
x2 -= 7
if keys[pygame.K_e]:
x3 = x + 30
y3 = y + 39
shoot = True
if shoot and x3 <= 1000:
x3 += 7