-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.py
More file actions
30 lines (25 loc) · 684 Bytes
/
init.py
File metadata and controls
30 lines (25 loc) · 684 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
# Import
import cv2
import sys
import random
import numpy as np
# Globals
WIDTH = 600 # Display Resolution Width
HEIGHT = 600 # Display Resolution Height
UNIT_BLOCK = 20 # Grid Size
PAUSE_TIME = 250 # Initial Pause Time
MIN_TIME = 125 # Minimum Wait Time
INC_LEVEL = 5 # Increment Level
SNAKE_LENGTH = 10 # Snake Length
EXIT_KEY = 27 # Escape Key
AI_MODE = 1 # Computer's Chance to Play with Mode (1) and You Can Play with Mode (0)
GREEN = (0, 255, 0)
RED = (0, 0, 255)
LEFT = -1
UP = -2
RIGHT = 1
DOWN = 2
grid_x = (WIDTH//UNIT_BLOCK)
grid_y = (HEIGHT//UNIT_BLOCK)
screen_width = grid_x * UNIT_BLOCK
screen_height = grid_y * UNIT_BLOCK