完成这个小球的完全弹性碰撞游戏灵感来自于:
下面是我花了一周下班时间所编写的一个小球完全弹性碰撞游戏:
修改小球的移动速度
tkinter *
修改游标数据从而改变小球移动速度的时候,小球移动的距离得不到及时的更新
一个星期的下班时间。在这个过程中不仅回去学习了高中的数学知识,
= { : : : : :
self.draw = Canvas(self,width=,height=,bg=
self.speed = Scale(self,orient=HORIZONTAL,label= from_=-100,to=100
self.speed.pack(side=BottOM,fill=
self.scaling_right = 4.8
self.scaling_left = 0.2
self.ball_d = 0.4
self.scale_value =
self.scaling = 100.0
self.balls =
self.ball_x =
self.ball_y =
self.ball_v_x =
self.ball_v_y =
self.ball = self.draw.create_oval(,,, fill= self.second_ball = self.draw.create_oval(,