- 104
- 3
- CPU
- i5-10500 3.2Ghz
- Dissipatore
- Non specificato
- Scheda Madre
- Non specificata
- HDD
- M.2 251GB e M.2 500GB
- RAM
- 16GB DDR4 2666mhz
- GPU
- Grafica Intel® UHD 630
- Audio
- Non specificata
- Monitor
- 1920x1080 27"
- PSU
- Non specificato
- Case
- Non specificato
- Periferiche
- Nono specificato
- Net
- Eolo
- OS
- Ubuntu
Sto creando un giochino in python. il probelma è che non mi stampa le immagini (Surface) al posto giusto le assegno delle cordinate ma non le stampa a quelle cordinate;
CODICE:
Sapete perchè grzie per l'aiuto!!
CODICE:
Codice:
import pygame
pygame.init()
schermo = pygame.display.set_mode((300, 600))
pygame.display.set_caption('Ping/pong')
ball_blue = pygame.image.load('C:/Users/Domenico/Desktop/pygame/Sprites/Pong/ball_blue.png').convert_alpha()
bar2_blue = pygame.image.load('C:/Users/Domenico/Desktop/pygame/Sprites/Pong/bar2_blue.png').convert_alpha()
sfondo = pygame.image.load('C:/Users/Domenico/Desktop/pygame/Backgrounds/Space.png').convert_alpha()
ball = pygame.transform.scale2x(ball_blue)
pareti_suono = pygame.mixer.Sound('C:/Users/Domenico/Desktop/pygame/Effects/SFX/beep_8.wav')
rachetta_suono = pygame.mixer.Sound('C:/Users/Domenico/Desktop/pygame/Effects/SFX/hit_1.wav')
def inizio():
global ball_x, ball_y, bar_x, bar_y
ball_x, ball_y = 150, 400
bar_x, bar_y = 150, 200
def disegna():
schermo.blit(sfondo, (0, 0))
schermo.blit(ball, (ball_x, ball_y))
schermo.blit(bar2_blue, (bar_x, bar_y))
def agiorna():
pygame.display.update()
pygame.time.Clock().tick(60)
inizio()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
disegna()
agiorna()
Sapete perchè grzie per l'aiuto!!