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
b082f57c
authored
Sep 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
3da41295
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
__pycache__/log.cpython-37.pyc
log.py
snake.py
__pycache__/log.cpython-37.pyc
View file @
b082f57c
No preview for this file type
log.py
View file @
b082f57c
...
@@ -2,7 +2,11 @@ class log:
...
@@ -2,7 +2,11 @@ class log:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
log
=
{}
self
.
log
=
{}
self
.
lognum
=
0
self
.
lognum
=
0
print
(
'log 1.0.0
\n
Hello from the log community.'
)
def
att_log
(
self
,
log_key
,
log_word
):
def
att_log
(
self
,
log_key
,
log_word
):
self
.
lognum
=
self
.
lognum
+
1
self
.
lognum
=
self
.
lognum
+
1
self
.
log
[
log_key
]
=
log_word
self
.
log
[
log_key
]
=
log_word
\ No newline at end of file
def
cutall_log
(
self
):
self
.
log
=
{}
\ No newline at end of file
snake.py
View file @
b082f57c
import
pygame
as
pg
import
pygame
as
pg
from
pygame
import
locals
from
log
import
log
from
log
import
log
# 初始化pygame,为使用pygame做准备
# 初始化pygame,为使用pygame做准备
...
@@ -7,3 +8,8 @@ pg.init()
...
@@ -7,3 +8,8 @@ pg.init()
# 创建一个窗口
# 创建一个窗口
win
=
pg
.
display
.
set_mode
((
800
,
600
))
win
=
pg
.
display
.
set_mode
((
800
,
600
))
win_log
=
log
()
win_log
=
log
()
while
True
:
for
event
in
pg
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
exit
()
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