# --- imports ---
import turtle
import random
# --- variables ---
x_title = -70
y_title = 60
game_title = "Gravity Code"
title = turtle.Turtle()
font_setup = ("Verdana", 25, "normal")
screen = turtle.Screen()
# --- main ---
screen.colormode(255)
title.speed("fastest")
title.hideturtle()
title.penup()
title.goto(x_title, y_title)
for i in range(len(game_title)):
r = random.randint(1, 255)
g = random.randint(1, 255)
b = random.randint(1, 255)
if game_title[i] != " ":
title.color((r, g, b))
x_title += 25
title.write(game_title[i], font = font_setup)
title.goto(x_title, y_title)
else:
x_title = -80
y_title = 30
title.goto(x_title, y_title)
# --- events ---
screen.mainloop()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…