-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses.py
More file actions
51 lines (41 loc) · 990 Bytes
/
Copy pathclasses.py
File metadata and controls
51 lines (41 loc) · 990 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
42
43
44
45
46
47
48
49
50
51
class Snake:
def __init__(self,color,x,y,d,ID):
self.color=color
self.x=x
self.y=y
self.d=d
self.ID=ID
self.point=0
self.growthFactor=0
def move(self):
y=self.y+(d%2)*(2-d)
x=self.x+((d+1)%2)*(3-d)
#if food:
#growth(food)
#elif nothing:
#apply move
#else
#apply death
class Food:
class GameEnv:
def __init__(self,top,right,down,left,blkSize):
self.top=top
self.right=right
self.down=down
self.left=left
self.blkSize=blkSize
self.gameOn=True
def drawEnv(self):
# to draw environment
pass
def play(self):
#move all snakes
pass
def addSnake(self,snake):
#generate an snake
pass
def killSnake(self.snakeID):
#kill the snake
pass
def GenerateFood(self):
#generate Food