
Lv.1
退 可加QQ2792558846or微信ldhc888666交流编程
签名:微 信;ldhc888666 我QQ;2792558846 B站;精神小伙李大黑 徒弟;pvz5阶橙卡冰西瓜 ,我是谁,我是一个小萌新1编程达人,___某人___ 目标10000赞6000收藏200000浏览1800再创 荣誉;2精选5新作 200强室长 编程协高级会员 拿过不少周边一回二等奖一回三等奖等(记不清了) NCT教程视频比赛人气第五。。。 太多了不列了 初三了忙了 怀念2020年(当时还是小学
在 联机教程。 中回复
# 导入第3方库——python游戏设计 random随机数
import pygame
import random
import sys
import pygame.freetype
import re
import datetime
'''
pygame
设计贪吃蛇
背景 食物 贪吃蛇
背景 白色
蛇 在屏幕中可以自由活动
食物 被吃后自动生成
'''
pygame.init()
# 背景绘制
screen = pygame.display.set_mode((500, 500))
# 食物
x = random.randint(10, 499)
y = random.randint(10, 499)
food_point = [x, y]
# snake
snake_list = [[10, 10]]
# snake移动
move_up = False
move_down = False
move_left = False
move_ringh = True
# 时钟
clock = pygame.time.Clock()
# 游戏循环
while True:
clock.tick(20)
# 填充背景
screen.fill([255, 255, 255])
pygame.draw.circle(screen, [255, 0,0], food_point, 15,0)
for snake in snake_list:
pygame.draw.circle(screen, [255, 0, 0], 15, 0)
pygame.display.update()
2020-06-14T11:21:15 点赞:0
在 我是大佬!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1 中回复
https://shequ.codemao.cn/work/43911141
https://shequ.codemao.cn/work/49647862
求投票
2020-06-20T22:11:12 点赞:0
在 【端午节活动】最终投票结果公布! 中回复
https://shequ.cod喵/work/43911141
https://shequ.cod喵/work/49647862
求投票
2020-06-21T07:51:56 点赞:0
在 求加入萌新院 中回复
https://shequ.codemao.cn/work/43911141
https://shequ.codemao.cn/work/49647862
求投票
2020-06-21T10:38:59 点赞:0