这些文件位于同一目录中。 这是我试图导入到其他文件中的函数:
RedInfantry = r"C:\Users\User\Desktop\a level computer science\Coursework\Week\Red team\InfantryRedV20.gif"
screen.addshape(RedInfantry)
#Red Infantry
def InfantryRed(x, y):
turtle = Turtle()
turtle.shape(RedInfantry)
turtle.penup()
turtle.goto(x, y)
Health = 10
Armour = 0
Attack = 1
Movement = 2
Capture = True
return turtle
这就是我试图做的:
from ImagesV4 import *
import turtle
ImagesV4.InfantryRed(200,200)
screen.update()
当我运行代码时,图像不会出现在屏幕上,也没有错误,只是一个空屏幕
相关问题 更多 >
编程相关推荐