We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Un juego elaborado mediante chatgpt
No response
The text was updated successfully, but these errors were encountered:
`import pygame import random
pygame.init()
WIDTH, HEIGHT = 600, 400 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("El juego de la banana 🍌🍊")
WHITE = (255, 255, 255) BLUE = (50, 50, 255) RED = (255, 0, 0)
banana_img = pygame.image.load("banana.png") banana_img = pygame.transform.scale(banana_img, (80, 80)) orange_img = pygame.image.load("orange.png") orange_img = pygame.transform.scale(orange_img, (100, 100))
frotar_sound = pygame.mixer.Sound("frotar.wav") # Sonido cuando se mueve chorro_sound = pygame.mixer.Sound("chorro.wav") # Sonido del "evento especial"
banana_x = WIDTH // 2 - 40 banana_y = HEIGHT // 2 orange1_x = WIDTH // 4 - 50 orange2_x = WIDTH * 3 // 4 - 50 orange_y = HEIGHT // 2
speed = 10 clicks = 0 chorreando = False chorro_intensity = 0 # Nivel de "presión"
running = True while running: screen.fill(WHITE)
# Dibujar naranjas screen.blit(orange_img, (orange1_x, orange_y)) screen.blit(orange_img, (orange2_x, orange_y)) # Dibujar banana screen.blit(banana_img, (banana_x, banana_y)) # Dibujar barra de intensidad pygame.draw.rect(screen, RED, (50, 350, chorro_intensity * 5, 20)) # Manejar eventos for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if event.type == pygame.MOUSEBUTTONDOWN: clicks += 1 chorro_intensity += 1 banana_x += random.choice([-speed, speed]) # Movimiento interactivo frotar_sound.play() # Reproducir sonido de fricción # Si se alcanzan muchos clics, activar "chorreo" if clicks > 10: chorreando = True chorro_sound.play() # Reproducir sonido del "evento" # Efecto de "chorreo" if chorreando: for i in range(chorro_intensity): pygame.draw.circle(screen, BLUE, (banana_x + 40, banana_y + 70 + i * 5), 5) # Gotas cayendo pygame.display.update()
pygame.quit()`
Sorry, something went wrong.
No branches or pull requests
What would you like to share?
Un juego elaborado mediante chatgpt
Additional information
No response
The text was updated successfully, but these errors were encountered: