Make enemy follow Player?
sokaroka
Member Posts: 9
I'm making a game similar to tilt to live on iPhone.
It's a survival game where you must avoid enemies that kill you when you touch them.
I need the enemies to move towards the Player.
Also can you make accelerate stop at a certain speed?
I want them to go towards the player at a speed of 100, not accelerate from 0 - 100, but just go at 100 the whole time.
Wrap up, how can I make the enemy move to the Player position at a set speed of 100?
It's a survival game where you must avoid enemies that kill you when you touch them.
I need the enemies to move towards the Player.
Also can you make accelerate stop at a certain speed?
I want them to go towards the player at a speed of 100, not accelerate from 0 - 100, but just go at 100 the whole time.
Wrap up, how can I make the enemy move to the Player position at a set speed of 100?
Comments
On your enemies have the behaviour:
Move to Player X, Player Y
That should do it...
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Do I use the expression editor?
I tried searching through that but found nothing...
On the player I got a Constrain attribute, setting self.Position.X/Y to PlayerX and PlayerY.
Then on the enemy I have move to PlayerX, PlayerY.
But then enemy moves to 0, 0
Which is the players starting position, so I didn't think it was continuously updating.
I then put a timer, to make the enemy move to PlayerX, PlayerY every 0.1 seconds, but it still just went to 0, 0 and stopped.
Please explain for a noob
Also you said just set the X and Y to the players x and y variables...
How do I do that?
If I use the expression editor on the enemy, I can't find Player in the "game" directory...
playersx and playersy both of them type real
the in your players do this
timer
every 2 seconds
change attribute game.playersx to self.position.x (or Constrain attribute)
and
change attribute game.playersy to self.position.y
then on your bullet do this
accelerate towards
game.playersx and game.playersy relative to scene
______
as allways thx to Tshirtbooth
The homing missiles, people and boss droids use a timed fast Accelerate to behaviour balanced with a heavy Drag.
Sorry, need to feed the baby. I'll post a more detailed explanation tomorrow.