Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson1_2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a9805961
authored
Sep 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
609880df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
__pycache__/log.cpython-37.pyc
log.py
snake.py
__pycache__/log.cpython-37.pyc
View file @
a9805961
No preview for this file type
log.py
View file @
a9805961
...
@@ -19,5 +19,12 @@ class log:
...
@@ -19,5 +19,12 @@ class log:
def
seet_log
(
self
,
key
):
def
seet_log
(
self
,
key
):
return
self
.
log
[
key
]
return
self
.
log
[
key
]
def
all_log
(
self
,
sep
):
return_log
=
""
for
i
in
self
.
log
:
return_log
=
return_log
+
i
return_log
=
return_log
+
sep
return
return_log
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
'log 1.0.0
\n
Hello from the log community.'
)
print
(
'log 1.0.0
\n
Hello from the log community.'
)
\ No newline at end of file
snake.py
View file @
a9805961
...
@@ -11,7 +11,17 @@ win_log.att_log("初始化","成功")
...
@@ -11,7 +11,17 @@ win_log.att_log("初始化","成功")
win
=
pg
.
display
.
set_mode
((
800
,
600
))
win
=
pg
.
display
.
set_mode
((
800
,
600
))
win_log
.
att_log
(
"窗口创建"
,
"成功"
)
win_log
.
att_log
(
"窗口创建"
,
"成功"
)
bg
=
pg
.
image
.
load
(
"bg.png"
)
right
=
pg
.
image
.
load
(
"right.png"
)
food
=
pg
.
image
.
load
(
"apple.png"
)
win_log
.
att_log
(
"素材创建"
,
"成功"
)
print
(
win_log
.
all_log
(
","
))
while
True
:
while
True
:
for
event
in
pg
.
event
.
get
():
for
event
in
pg
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
if
event
.
type
==
locals
.
QUIT
:
exit
()
exit
()
\ No newline at end of file
win
.
blit
(
bg
,
(
0
,
0
))
win
.
blit
(
right
,
(
290
,
120
))
win
.
blit
(
food
,
(
360
,
300
))
\ No newline at end of file
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