Commit b2bdeb94 authored by jwacyk's avatar jwacyk
Browse files

modification sauvegarde

parent 22c9506f
......@@ -2,14 +2,12 @@ import pygame
import constants
import player
import sys
import datetime
class Menu(object):
def __init__(self):
pygame.font.init()
my_font = pygame.font.SysFont("arial",17)
self.save_number = 0
self.quit_text = my_font.render("QUIT", True, constants.BLACK)
self.save_text = my_font.render("SAVE", True, constants.BLACK)
self.black_rect = pygame.Rect(10, 10, 30, 30)
......@@ -77,8 +75,8 @@ class Menu(object):
player.set_color(constants.DARK_GRAY)
return True
elif self.save_button_rect.collidepoint(position):
self.save_number += 1
pygame.image.save(background, "Image_" + str(self.save_number) + ".png")
now = datetime.datetime.now()
pygame.image.save(background, "Image_" + str(now) + ".png")
return True
elif self.quit_button_rect.collidepoint(position):
pygame.quit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment