Bao’s Drawing Program

Step right up to BaoECheese folks, and take a look at this spicy program I’ve been working on (I know it’s not super impressive but pls don’t yell at me I am smol)

import turtle

papa = turtle.Turtle()
wn = turtle.Screen()
wn.bgcolor("black")
#this sets the background color
def h1():
    papa.reset()
    #clears any drawings that are still on screen and reset position
    papa.hideturtle()
    #papa.tracer(0 , 0)
    # the line above draws the drawing instantly
    papa.speed(0)
    #sets the speed to the fastest (warping) 
    for i in range(400):
        papa.pencolor("magenta")
        papa.forward(i)
        papa.right(30)
        papa.pencolor("yellow")
        papa.forward(20)
        papa.left(60)
        papa.forward(20)
        papa.forward(50)
        papa.right(30)
    
        papa.penup()
        papa.setposition(0, 0)
        #sets turtle to the middle of the screen before drawing
        papa.pendown()
        
        papa.right(2)
        
def h2():
    papa.reset()
    papa.hideturtle()
    papa.speed(0)
    for o in range(300):
        papa.pencolor("black")
        papa.forward(20)
        papa.right(15)
        papa.forward(40)
        papa.left(30)
        papa.pencolor("white")
        papa.forward(20)
        papa.right(30)
        papa.forward(o)
        papa.left(40)
        papa.forward(15)
        papa.right(35)


        papa.penup()
        papa.setposition(0, 0)
        papa.pendown()
        
        papa.right(2)

def h3():
    papa.reset()
    papa.hideturtle()
    papa.setposition(0,0)
    papa.speed(0)
    papa.pencolor("blue")
    for s in range(500):
        papa.forward(s)
        papa.right(120)
        papa.left(25)
        papa.forward(60)
        papa.right(40)

def h4():
    papa.reset()
    papa.hideturtle()
    papa.speed(0)
    papa.setposition(0,0)
    papa.pencolor("steelblue")
    for w in range(1000):
        papa.forward(w)
        papa.left(120)
        

def h5():
    papa.reset()
    


        
wn.onkey(h1, "Up")
wn.onkey(h2, "Left")
wn.onkey(h3, "Right")
wn.onkey(h4, "Down")
wn.onkey(h5, "space")
wn.listen()
turtle.mainloop()
    

    


Right, so I just wanted to do something simple on turtle graphics because Python coding is pretty simple and I suck at programming. And what other way to make a spicy program than using turtle graphics?
So I looked through a few websites for some examples n ideas. I ended up making a program where it draws stuff after pressing an arrow key. Pretty generic but yanno, I’ll try to improve it and make it fancy-ish..somehow.
Edit: Well, all I’ve been doing is fixing the drawings and made them a bit fancier. But that’s it, my programming skill is limited and this is all I know how to do :^) and yes, I am aware it’s still buggy af, pls don’t yell at me I am soft.

Leave a Reply

Your email address will not be published. Required fields are marked *