In this case, I guess it has a simple AI, which just decide, if the player is on the right or left side. So based on that, it just decides to jump to the left or to the right, nothing more.
Usually characters in this type of games are from type KinematicBody
. So the easiest way to archieve this is to have a reference to the player and some logic in the process function, which does nothing more than decide, whether the player is to the left or to the right (as mentioned above) and then set the velocity of the body corresponding to the direction of the player.
Good Luck!