Snake game is this correct or not I don't know

import pygame
import time
import random

width,height = 1000, 700

win = pygame.display.set_mode((width, height))

pygame.display.set_caption(‘spacedodge’)

player_width = 40
player_height = 60

def draw(player):
win.blit(bg, (0,0))

pygame.draw.Rect(win, 'red', player) 

pygame.display.update()

def main():

run = True

player = pygame.Rect(200, height - player_height, player_width, player_height)

while run:
  
    for event in pygame.event.get():
  
        if event.type == pygame.QUIT:
  
            run = False
  
            break

    draw(player)    

pygame.quit() 

if name == ‘main’:

main()

In order to preserve formatting, please select any code or traceback that you post and then click the </> button.

2 Likes