Hi,
Replace this:
Code:
on_d = move_right;

With this:
Code:
while(1){
  Player_2.pos_x +=5*(key_d-key_a)*time_step;
  wait(1);
}