Talk:Enemy AI That Follows The Character Done Right/@comment-15974427-20150619031529

I'm using this for a game, and there's a thing I want to be fixed:

Okay, let's say my location on the screen is x150 y150. The enemy's is x100 y150.

The enemy moves to me (it moves to the right). When it reaches me, its location keeps changing between 149 and 151, but it never reaches exactly 150 (for example, it can just give random numbers between 149.600 and 150.400). That's a big problem in my program, where the enemy needs to stay on the exact same pixel. How can I fix that?

Note: It happens on whichever direction the enemy is coming from. It also happens whatever the FRICTION variable is.