Member-only story
Snake Game In Python Using Pygame
5 min readMay 29, 2022
A. First of all let us make a screen
- For this we need to import pygame
import pygame
- Initialization of the pygame
pygame.init()
- Define the background color
green=pygame.Color(0,255,0)
- Mention the width and height of the screen
window_x_axis=840window_y_axis=600
- pygame.display.set_caption :- Set the current window caption
pygame.display.set_caption('Snake Game')
- pygame.display.set_mode:- Initialize a window or screen for display
game_window=pygame.display.set_mode((window_x_axis,window_y_axis))
- Filing the background color
game_window.fill(green)
- pygame.display.update() :- Update portions of the screen for software displays
pygame.display.update()
Now, Let us build the Screen with background color and the suitable title.
OUTPUT