moving from one side of screen to other

For future reference, check out this thread about how to post code directly into the forums, nicely formatted: Using code tags properly
(better than a screenshot).

My first suggestion would be to move your ‘else’ statement to inside the “if(alive)” block, after the distance/move code.
Right now, your code is only modifying the direction when ‘alive’ is false. :slight_smile: