Skip to content
Snippets Groups Projects
Commit a2bd215e authored by to's avatar to
Browse files

ça suit le tp

parent 9060f783
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,13 @@ green = (0, 255, 0) ...@@ -14,6 +14,13 @@ green = (0, 255, 0)
blue = (50, 153, 213) blue = (50, 153, 213)
# Step 1: Defining the window's graphical variables # Step 1: Defining the window's graphical variables
unite = 10
largeur_zone = 60
hauteur_zone = 40
couleur_nourriture = red
couleur_serpent = green
couleur_fond = white
# Step 2.3: Showing a square in the window # Step 2.3: Showing a square in the window
def draw_square(x: int, y: int, colour: tuple): def draw_square(x: int, y: int, colour: tuple):
...@@ -62,7 +69,7 @@ def game_turn(snake, end, direction, food): ...@@ -62,7 +69,7 @@ def game_turn(snake, end, direction, food):
# Initialisation of the game window ==> do not delete # Initialisation of the game window ==> do not delete
pygame.init() pygame.init()
# Step 2.1: replace 100,100 by using the correct variables # Step 2.1: replace 100,100 by using the correct variables
console = pygame.display.set_mode((100,100)) console = pygame.display.set_mode((largeur_zone, hauteur_zone))
# Set window title # Set window title
pygame.display.set_caption("Snake by Rubika_BI1_Anim3D") pygame.display.set_caption("Snake by Rubika_BI1_Anim3D")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment