snake game
import pygame import random import os pygame.init() pygame.mixer.init() #colors white=( 255 , 255 , 255 ) red=( 255 , 0 , 0 ) black=( 0 , 0 , 0 ) #game window screen_w= 500 screen_h= 500 gamewindow=pygame.display.set_mode((screen_w , screen_h)) pygame.display.set_caption( "snake game" ) clock=pygame.time.Clock() #background image=pygame.image.load( "background.jpg" ) image=pygame.transform.scale(image , (screen_w , screen_h)).convert_alpha() #text on screen font=pygame.font.SysFont( None, 30 ) def screentext (text , color , x , y): textonscreen=font.render(text ,True, color) gamewindow.blit(textonscreen , [x , y]) #snake length increment(plotting snake) def plotsnake (gamewindow , color , snk_list , snake_size): for x , y in snk_list: pygame.draw.rect(gamewindow , color , [x , y , snake_size , snake_size]) def welcome (): pygame.mixer.music.load( "snakeGameback.mp3" ) pygame.mixer.music.set_volume( 0.7 ) pygame.mixer.music.p...