Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson3_diy2

  • This project
    • Loading...
  • Sign in
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 dcd0c6f2 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 315578c9 c199592l1354p256a13983/wx958301
Hide whitespace changes
Inline Side-by-side
Showing with 8 additions and 1 deletions
  • COMIC.TTF
  • COMICBD.TTF
  • COMICI.TTF
  • COMICZ.TTF
  • simfang.ttf
  • snake.py
  • ssssbbbb.py
COMIC.TTF 0 → 100644
View file @ dcd0c6f2
File added
This diff is collapsed. Click to expand it.
COMICBD.TTF 0 → 100644
View file @ dcd0c6f2
File added
This diff is collapsed. Click to expand it.
COMICI.TTF 0 → 100644
View file @ dcd0c6f2
File added
This diff is collapsed. Click to expand it.
COMICZ.TTF 0 → 100644
View file @ dcd0c6f2
File added
This diff is collapsed. Click to expand it.
simfang.ttf 0 → 100644
View file @ dcd0c6f2
File added
This diff is collapsed. Click to expand it.
snake.py
View file @ dcd0c6f2
......@@ -17,7 +17,7 @@ body = pygame.image.load('body.png') # 身体
left = pygame.image.load('left.png') # 头 朝左
up = pygame.image.load('up.png') # 头 朝上
down = pygame.image.load('down.png') # 头 朝下
my_font = pygame.font.Font('vga936.fon',18)
my_font = pygame.font.Font('COMICBD.TTF',30)
x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)]
......@@ -61,10 +61,13 @@ while True:
if x == apple_x and y == apple_y:
n11111 = random.randint(1,22)
n22222 = random.randint(1,16)
score += 1
apple_x = 30*n11111-30
apple_y = 30*n11111-30
else:
position.pop(0)
if x < 0 or x > 630 or y < 0 or y > 450:
exit()
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇的头画上去
......
This diff is collapsed. Click to expand it.
ssssbbbb.py 0 → 100644
View file @ dcd0c6f2
import pygame
a = pygame.font.get_fonts()
print(a)
\ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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 sign in to comment