All Projects → archtaurus → pysnake

archtaurus / pysnake

Licence: GPL-3.0 license
Python贪吃蛇游戏

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Python/Pygame 贪吃蛇游戏 编程视频教程

screenshot

需求 REQUIREMENTS

启动游戏 USAGE

$ git clone [email protected]:archtaurus/pysnake.git
$ cd pysnake
$ make play

游戏控制 CONTROL

  • 上下左右方向按键 => 控制方向
  • R => 重新开始
  • ESC => 退出游戏

视频教程及源码列表 DAY by DAY TUTORIALS

第一季 SEASON 1

视频教程第1集 视频教程第2集

277字节的Snake程序

from pygame import*;d=display;y,D,S=s=[15,16,17];n,p,x=D,99,d.set_mode([225]*2).fill
while s.count(S)%2*S%n*(S&240):
 for e in event.get(2):D=(-1,-n,n,1)[e.key&3]
 s=s[p!=S:]+[S+D];x(-1)
 if p==S:p=s[0]
 for i in[p]+s:x(0,((i-1)%n*y,(i-n)/n*y,y,y))
 d.flip();S+=D;time.wait(99)

Classic Snake Playing

classic_snake_playing

联系老赵 CONTACT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].