if isCollision(enemyX[i], enemyY[i], bulletX, bulletY):
bulletY = PLAYER_START_Y
bullet_state = "ready"
score_value += 1
enemyX[i] = random.randint(0, SCREEN_WIDTH - 64)
enemyY[i] = random.randint(ENEMY_START_Y_MIN, ENEMY_START_Y_MAX)
enemy(enemyX[i], enemyY[i], i)
# Bullet Movement
if bulletY <= 0:
bulletY = PLAYER_START_Y
bullet_state = "ready"
elif bullet_state == "fire":
fire_bullet(bulletX, bulletY)
bulletY -= bulletY_change
player(playerX, playerY)
show_score(textX, textY)
pygame.display.update()
To embed this project on your website, copy the following code and paste it into your website's HTML: