+ 2
Why this code is not execute ? It is only show white screen. I want button s in the screen.
import pygame import sys pygame.init() screen = pygame.display.set_mode((600,400)) def button (bx,by,laenge,hoeho,farbe_normal,farbe_aktive): if mouse[0] > bx and mouse[0] < bx +laenge and mouse[1] > by and mouse[1] < by + hoeho: pygame.draw.rect(screen,farbe_aktive,(bx,by, laenge,hoeho)) else: pygame.draw.rect(screen,farbe_normal,(bx,by, laenge,hoeho)) go = True while go: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() pygame.quit() screen.fill((255,255,255)) mouse = pygame.mouse.get_pos() button =(150,170,120,60,(150,0,0),(255,0,0)) button = (350,170,120,60,(0,150,0),(0,255,0)) pygame.display.flip()
1 ответ
+ 2
Can you please tell where you have returned your goal in html or in python because that also matters if you have written this code on HTML then definitely you will get only white screen and if you have written this code on python then this code will not work please tell us on which you have written this.
Hope you understand
Rock the code 🤟🤟