Skip to content

Instantly share code, notes, and snippets.

@bluemyria
Created November 10, 2017 16:32
Show Gist options
  • Save bluemyria/8dd481a4671a41bd96b6fa9f643a3036 to your computer and use it in GitHub Desktop.
Save bluemyria/8dd481a4671a41bd96b6fa9f643a3036 to your computer and use it in GitHub Desktop.
# Creating Ground
def creating_playground(self):
self.board=Tkinter.Canvas(self, width=PLAYGROUND_WIDTH, height=PLAYGROUND_HEIGHT, background=PLAYGROUND_COLOR)
self.board.pack(padx=10, pady=10)
return
# Creating Snake Moving Settings
def creating_snake_moving_settings(self):
self.x=SNAKE_MOVING_SPEED
self.y=0
self.roadmap=[(0,0)]
self.bodylength=3
self.snake_food=None
self.gamevalid=1
self.score=0
return
# Creating snake Head
def creating_snake_head(self):
self.snake=self.board.create_rectangle(1,1,11,11,fill=SNAKE_HEAD_COLOR)
return
# Creating Turning Function
def turn_left(self):
self.x=-SNAKE_MOVING_SPEED
self.y=0
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment