From 44796e9f186658a75dc75291c5c3c613ee47ff99 Mon Sep 17 00:00:00 2001 From: Sakyi Mustapha Date: Thu, 14 Aug 2025 22:55:34 +0000 Subject: [PATCH] added player 3c setup and function --- cargmae/cargame.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cargmae/cargame.py b/cargmae/cargame.py index 11c5688..d5cc465 100644 --- a/cargmae/cargame.py +++ b/cargmae/cargame.py @@ -33,6 +33,15 @@ player2.penup() player2.goto(-350, -100) +#player 3 setup +player3 = turtle.Turtle() +player3.speed(0) +player3.shape("square") +player3.color("yellow") +player3.shapesize(staretch_wid=1, stretch_len=2) +player3.penup() +player3.goto(-350, -100) + # Player 1 movement function def move_player1(): x = player1.xcor() @@ -45,11 +54,17 @@ def move_player2(): x += 10 player2.setx(x) +#player 3 movement function +def move_player3(): + x = player3.xcor() + x += 10 + player3.setx(x) # Keyboard bindings wn.listen() wn.onkey(move_player1, "w") wn.onkey(move_player2, "Up") + # Main game loop while True: wn.update()