Python Snake Game With Source code
Python Snake Game Source code import pygame pygame.init() import random import time import sys #Colors-- Blue=(9,14,217) White=(255,255,255) Black=(0,0,0) Green=(0,200,0) Light_Green=(0,255,0) Purple=(201,29,201) Yellow=(255,255,0) Red=(255,0,0) #Setup Screen-- wn=pygame.display.set_mode((820,440)) pygame.display.set_caption('SNAKE_GAME') clock=pygame.time.Clock() #Function For Length oF Snake-- #snk_list=[snk_x,snk_y] contain-- def plot_snk(wn,color,snk_list,snk_length,snk_breadth): for x,y in snk_list: # To join more rectangle with initial head's snake- pygame.draw.rect(wn,color,[x,y,snk_length,snk_breadth]) #Draw Rectangle #To Print Text In Screen- Font1=pygame.font.SysFont('italics',59) def text_screen1(text,color,x,y): text_screen=Font1.render(text,True,color) wn.blit(text_screen,[x,y]) #For Highscore_text-- Font2=pygame.font.SysFont(0,42) def text_screen2(text,color,x,y): text_screen=Font2.render(text,True,color) wn.blit(t