16关动态地图
def update(context): ms =context.monsters me = context.me t=context.step/40 if t<0.2: return api.a2r(25) elif 6<t<6.2 : return api.a2r(155) #从 ms 中获取与本星体直接距离最近的星体,ignore_bullet=False不忽略星体发射的子弹星体。 me_near = me.find_nearest_atom(ms, ignore_bullet=False) if me_near.radius < me.radius and me_near.radius*2 > me.radius and me.whether_collide(me_near): #控制本星体向指定的星体发射炮弹,返回发射炮弹的弧度值 if context.step % 10 == 3: return me.shoot_atom_radian(me_near)+3.14 elif me_near.radius < me.radius and me.whether_collide(me_near): return None elif me.whether_collide(me_near) and me.get_atom_surface_dist(me_near)<100: return me.shoot_atom_radian(me_near) return None