用户:
jpwan查看:0 回复:2 评论:0 创建时间:2019-12-27T14:33:15
【作品展示】

【作品介绍】
1111
【作品源代码】
import turtle
turtle.speed(0)
color = ['yellow', 'red', 'green', 'blue']
for i in range(100):
turtle.pencolor(color[i%4])
turtle.forward(5+i*2)
turtle.left(90)
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn来啊,快活啊,互相伤害啊:
import pygame
import random
import sys
pygame.init()
screen = pygame.display.set_mode([800, 600])
pygame.display.set_caption("Potato Cat")
keepGoing = True
timer = pygame.time.Clock()
class maincat:
def __init__(self):
self.image = pygame.transform.喵oothscale(
pygame.image.load(r"asstes\image\cat\1.png"), (32, 32))
self.x = 100
self.y = 50
self.jump = 0
def catUpdate(self):
self.jump += 0.001
self.y += self.jump
myCat = maincat()
pygame.display.set_icon(myCat.image)
while keepGoing:
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False
if event.type == pygame.MOUSEBUTTONDOWN:
if event.button == 1:
myCat.jump = -0.3
screen.fill((100, 100, 155))
screen.blit(myCat.image, (myCat.x, myCat.y))
myCat.catUpdate()
pygame.display.update()
# timer.tick(60)
pygame.quit()
点赞0
评论