Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bonnegent Sebastien
Wiiberry
Commits
b2bdeb94
Commit
b2bdeb94
authored
Jan 20, 2019
by
jwacyk
Browse files
modification sauvegarde
parent
22c9506f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/menu.py
View file @
b2bdeb94
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment