Python 在输入初始速度和发射角度之前,“我的画布”不会显示墙的位置

Python 在输入初始速度和发射角度之前,“我的画布”不会显示墙的位置,python,python-3.x,vpython,Python,Python 3.x,Vpython,我正在制作一个流行游戏《愤怒的小鸟》的简化版本,一只小鸟被发射到墙上,一系列的计算被用来决定小鸟是否能撞到墙上,如果可能的话,是否能把它推倒。但是我的画布在你输入初始速度和发射角度之前不会显示墙的位置。有人能帮我吗?非常感谢! 这是我关于场景的代码 scene = canvas(width=640, height=480, center=vector(8,0,0),range=8)#scene ground = curve(pos=[(0,0,0),(16,0,0)],color=color.g

我正在制作一个流行游戏《愤怒的小鸟》的简化版本,一只小鸟被发射到墙上,一系列的计算被用来决定小鸟是否能撞到墙上,如果可能的话,是否能把它推倒。但是我的画布在你输入初始速度和发射角度之前不会显示墙的位置。有人能帮我吗?非常感谢! 这是我关于场景的代码

scene = canvas(width=640, height=480, center=vector(8,0,0),range=8)#scene
ground = curve(pos=[(0,0,0),(16,0,0)],color=color.green)#set up ground
target = box (pos= vector(targetx,1.0,0), length=0.5, width=0.5, 
height=2.0)#set up target wall
bird = sphere(pos = vector(0,0,0), radius = 0.05, make_trail=True )#set up bird
#mylabel = canvas.create_text((0, 20), text="Label text")

曲线位置必须是向量列表,如下所示:

曲线(位置=[向量(0,0,0),向量(16,0,0)],颜色=颜色。绿色)

您需要定义targetx