elif event.key == pygame.K_SPACE:
position = pygame.mouse.get_pos()
if (PlayCharNum == 0):
if(time.time() - timeset >= 1.5):
timeset = time.time()
angle_sw = math.atan2(position[1]-(playerpos[1]+32),position[0]-(playerpos[0]+26)) -
sw_loc = pygame.transform.rotate(arrow, 360-angle_sw*57.29)
swpos1 = (playerpos[0]+3, playerpos[1]-playerrot.get_rect().height//2)
screen.blit(sw_loc, swpos1)
attack = 1
temp = 0.5
I would like to create a code that attacks the bullet picture by rotating it 90 degrees when the space bar is pressed.
bullet The picture appears briefly