Réglage de la vibration du bot lorsqu'il y a peu de FPS #15
|
@ -558,8 +558,10 @@ def _update_bot(world: World):
|
|||
|
||||
# On se déplace vers la meilleure option
|
||||
diff = target - bot[Position].y
|
||||
if abs(diff) > 10:
|
||||
if abs(diff) > bot[Speed] * world[Delta]:
|
||||
bot[Position].y += (diff / abs(diff)) * bot[Speed] * world[Delta]
|
||||
else:
|
||||
bot[Position].y = target
|
||||
|
||||
|
||||
def __check_bonus_collision(world: World):
|
||||
|
|
Loading…
Reference in a new issue