Python Forum
I am trying to make a Colour Wars game, "Winning code" missing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I am trying to make a Colour Wars game, "Winning code" missing
#1
Can somebody help? The goal of the game is, that you have a turtle, that you control with arrows, and the turtle paints down color as it moves. How you win - you fill up the whole screen with your color, and that is the part of the code, that I don' have. python Code:
import turtle
import math
        
troncycle = turtle.Turtle()
screen = turtle.Screen()
troncycle.pensize(75)
troncycle.color("dark blue")
troncycle.pencolor("blue")
turtle.setup(500, 500)

troncycle.penup()
troncycle.left(180)
troncycle.forward(25)
troncycle.pendown()

def moveright():
    troncycle.right(90)                
                
def moveleft():
    troncycle.left(90)
                                                    
for i in range(100000):
                           
    troncycle.forward(2)   
  
    screen.listen()
                  
    screen.onkeypress(moveright, "Right")
    screen.onkeypress(moveleft, "Left")
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Missing parts of Code Felipe1991_GVT 3 275 Mar-22-2024, 05:58 PM
Last Post: deanhystad
  needing some help to write some code for a game calculator rymdaksel 1 405 Jan-02-2024, 09:56 AM
Last Post: deanhystad
  hi need help to make this code work correctly atulkul1985 5 778 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  newbie question - can't make code work tronic72 2 680 Oct-22-2023, 09:08 PM
Last Post: tronic72
  Cleaning my code to make it more efficient BSDevo 13 1,360 Sep-27-2023, 10:39 PM
Last Post: BSDevo
  how to make bot that sends instagram auto password reset code kraixx 2 1,367 Mar-04-2023, 09:59 PM
Last Post: jefsummers
  Make code non-blocking? Extra 0 1,131 Dec-03-2022, 10:07 PM
Last Post: Extra
  How do I make a game save? BliepMonster 6 1,529 Oct-09-2022, 08:59 AM
Last Post: Gribouillis
  Problem with my pong game code Than999 8 3,840 May-15-2022, 06:40 AM
Last Post: deanhystad
  Make the code shorter quest 2 1,505 Mar-14-2022, 04:28 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020