Giới thiệu sản phẩm
import turtle
import os
#Import the tt module
import turtle
# Set up the screen
turtle.speed(0)
#Set the Bg clolor
turtle.bgcolor("black")
# Hide the default turtle
turtle.ht()
#Save memories
turtle.setundobuffer(1)
#This speed up the drawing
turtle.tracer(1)
# Define the Sprite class
class Sprite(turtle.Turtle):
def __init__(self, spriteshape, color, startx, starty):
super().__init__(shape=spriteshape) # Initialize the base class
self.penup()
self.speed(0)
self.color(color)
self.goto(startx, starty)
self.speed = 1 # Custom attribute
# Create an instance of Sprite
player = Sprite("triangle", "white", 0, 0)
# Keep the window open
turtle.done()
10% code (Tao background va nhan vat cho game )
Hình ảnh sản phẩm
Hãy bình luận để nhặt 100 thóc nhé
Sản phẩm cùng tác giả
Sản phẩm liên quan
Không có sản phẩm nào
Đăng nhập để tham gia bình luận