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 > bx and mouse < bx +laenge and mouse > by and mouse < 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()
5/29/2020 7:37:27 AMAllamprabhu Hiremath
1 AnswerNew Answer
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 🤟🤟