A simple way of moving sprites that was commonly used in NES games is IF PLAYER IS LEFT THEN MOVE ENEMY LEFT. That is disgusting. It makes for very choppy movement. What you need is trigonometry! I'll explain. There is a distance between the player sprite and the enemy sprite; X distance and Y distance. The two make an angle. To make the enemy move on this angle, you need to calculate the sine and cosine. You also need the Pythagorean theorem. Remember soh cah toa. Sine = Opposite/Hypotenuse, Cosine = Adjacent/Hypotenuse, Tangent = Opposite/Adjacent. So the adjacent is your X, and the opposite is Y. With this, we can make the enemy move. But we still need the hypotenuse. We can find the hypotenuse with the Pythagorean theorem. Here's my code:
EX=EX+(EX-PX)/SQR(POW(EX-PX,2)+POW(EY-PY,2))
EY=EY+(EY-PY)/SQR(POW(EX-PX,2)+POW(EY-PY,2))
This is written in SmileBASIC code just to be clear. So since Leg_{1}^{2}+Leg_{2}^{2}=Hypotenuse^{2}, we found Hypotenuse^{2}, then found the square root of it to find the length of the hypotenuse. That's pretty much it. I hope this wasn't too complex. If you have any questions tell me in the comments.

4 Comment(s)JustGreatFirst MonthJoined in the very first month of SmileBASIC SourceWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsiteNight PersonI like the quiet night and sleep late.Express YourselfWell I thought this was at least a little bit obvious, but nice tutorial nonetheless!GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThank you!SpaceKadetaYou have thoughtful ways of programming, can I say, I have tried to this doing one COS(ATAN( )) function. and it worked well. Do you know if there are commons or differences that can be achieved through successfully implimenting a round versus a fraction versus a decimal sum? I.E how fast will the enemy process its current momevent equations? Because I get this fr and feel stuck. GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthI'm sorry, I don't know. I don't understand the question very well either. Maybe someone else could help here.