-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.py
More file actions
41 lines (34 loc) · 779 Bytes
/
Settings.py
File metadata and controls
41 lines (34 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pygame
import Main
import random
import Functions
import Menu
import sys
lightgray = (211, 211, 211)
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
points = 0
highscore = list()
fps = 5
pygame.init()
a = pygame.image.load('icon.png')
pygame.display.set_caption('Snake')
pygame.display.set_icon(a)
fpsClock = pygame.time.Clock()
SWidth, SHeight = 640, 480
GRIDSIZE = 10
GRID_WIDTH = SWidth / GRIDSIZE
GRID_HEIGHT = SHeight / GRIDSIZE
UP = (0, -1)
DOWN = (0, 1)
LEFT = (-1, 0)
RIGHT = (1, 0)
PAUSE = (0, 0)
screen = pygame.display.set_mode((SWidth, SHeight), 0, 32)
surface = pygame.Surface(screen.get_size())
surface = surface.convert()
surface.fill((255, 255, 255))
clock = pygame.time.Clock()
pygame.key.set_repeat(1, 40)
screen.blit(surface, (0, 0))