Making the School Project Menu with Pygame-menu [School Project] {EDITED} | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Making the School Project Menu with Pygame-menu [School Project] {EDITED}

Hey there everyone. I started to look at the pygame library to do the school project, and as most of you already know, this game will be a math based game. However, my teacher told me to make a menu before doing anything. Here is the code (I also used Pygame-menu). import pygame import pygame_menu from pygame import mixer pygame.init() #Mida i nom de la finestra surface = pygame.display.set_mode((600, 400)) pygame.display.set_caption("Projecte MatZanfe") #Logotip de la finestra logotip = pygame.image.load("calculator.png") pygame.display.set_icon(logotip) font = pygame_menu.font.FONT_8BIT font1 = pygame_menu.font.FONT_NEVIS def start_the_game(): # Do the job here ! pass menu = pygame_menu.Menu('Projecte MatZanfe', 600, 400, theme=pygame_menu.themes.THEME_SOLARIZED) menu.add.text_input('Usuari: ', font_name = font1, font_color = 'blue') mixer.music.load('MusicaMenu.wav') mixer.music.play(-1) menu.add.button('Comencem', start_the_game,font_name = font, font_color = 'green') menu.add.button('Sortir', pygame_menu.events.EXIT, font_name = font,font_color = 'red') menu.mainloop(surface) I already solved the issue.

12th Aug 2021, 3:37 PM
Pol C
Pol C - avatar
1 Answer
+ 1
Try finding a guide video from youtube that is how i learnt pygame really well sorry can't explain for you now because I am in a hurry
13th Aug 2021, 12:28 PM
Chris Jonathan
Chris Jonathan - avatar