GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Enemys Constant moving to player

brett-nortonbrett-norton Posts: 64Member, BASIC

Hi Guys hope everyone is well.

Stuck again with a little problem if anyone could help, I have a scene about 5000 pixels wide and want to have enemy's spawn in from far sides of the screen and then move to the player and attack.

Problem is when the enemy's reach the players position they stop and dont continue to follow.

I have the usual real attributes Playerx & PlayerY constrained to player position X and Y.

Code so far -
In the enemys i have move to - PlayerX - PlayerY.

I also tried updating the PlayerX - Player Y every 0.5 seconds.

I also tried:

if Enemys position x is => - Move left
if Enemys position x is =< - Move Right

Which worked ok for a while but then decided to stop working and it also didn't seem to move actors that were way out on the edges of the scene. Any ideas??

Thanks in advance.

Comments

Sign In or Register to comment.