@MilCOS
2016-04-17T20:42:18.000000Z
字数 664
阅读 719
作业
Vpython
抛物线
(1)半空中撞击
、(2)砸到地面时,目标落入有效范围
# 1.反弹
if bomb.pos.y < bomb.radius:
bomb.velocity.y = abs(bomb.velocity.y)
# 2.(1)半空中撞击
if abs(bomb.pos.x-target.pos.x) <= t_r and abs(bomb.pos.z-target.pos.z) <= t_r and bomb.pos.y<=distance1:
# 2.(2)砸到地面时,目标落入有效范围
if mag(bomb.pos-target.pos)<=distance2 and bomb.pos.y<= distance1: