Giới thiệu sản phẩm
turtle crossing road:
import turtle
from player import Player
from turtle import Screen
import time
screen = Screen()
screen.title("Turtle crossy road")
screen.setup(width=600, height=500)
screen.bgcolor("white")
screen.tracer(0)
def create_color(r, g, b):
return (r / 255, g / 255, b / 255)
thy = Player(create_color(242, 213, 213), (150, 0))
triet = Player(create_color(84, 82, 83), (-150, 0))
screen.onkeypress(thy.go_up, "Up")
screen.onkeypress(thy.go_down, "Down")
screen.onkeypress(triet.go_up, "w")
screen.onkeypress(triet.go_down, "s")
screen.listen()
counter = 0
square = turtle.Turtle()
square.shape("square")
square.color("black")
square.goto(-300, 0)
square.penup()
game_is_on = True
while game_is_on:
time.sleep(0.1)
screen.update()
counter += 1
square.forward(10)
screen.mainloop()
import turtle
from player import Player
from turtle import Screen
import time
screen = Screen()
screen.title("Turtle crossy road")
screen.setup(width=600, height=500)
screen.bgcolor("white")
screen.tracer(0)
def create_color(r, g, b):
return (r / 255, g / 255, b / 255)
thy = Player(create_color(242, 213, 213), (150, 0))
triet = Player(create_color(84, 82, 83), (-150, 0))
screen.onkeypress(thy.go_up, "Up")
screen.onkeypress(thy.go_down, "Down")
screen.onkeypress(triet.go_up, "w")
screen.onkeypress(triet.go_down, "s")
screen.listen()
counter = 0
square = turtle.Turtle()
square.shape("square")
square.color("black")
square.goto(-300, 0)
square.penup()
game_is_on = True
while game_is_on:
time.sleep(0.1)
screen.update()
counter += 1
square.forward(10)
screen.mainloop()
Hình ảnh sản phẩm

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
quá là xịn sò luôn ạ
Đăng nhập để tham gia bình luận
Đăng nhập để tham gia bình luận
Đăng nhập để tham gia bình luận
giỏi quá ạ
Đăng nhập để tham gia bình luận
i like it✨
Đăng nhập để tham gia bình luận
Đăng nhập để tham gia bình luận