Stationary Enemies.

phoenix916

  • Posts: 23
I was wondering if I could make my player (enemies) constantly stays at the left side of the screen ? and the main player is at the center of the screen. When the main player slows down the enemies get closer to the main player. How can I do so ? The camera sticks with the main player. so how can I set the enemies to get closer to the main player if he slows down ?

Medevenx

  • Posts: 65
is this like running? i suggest giving the player a variable type of x-movement where there is a max velocity set or x-speed limit.

then the enemies would have a CONSTANT velocity which is equal/slightly less than the max velocity of the player and place the enemies a distance x from the player.

this way if he's moving at his max speed he would never be chased down by the enemies unless he slows down or comes to a full stop

also, making the enemies constant velocity slight less than the player's max velocity allows him to regain his lead (pretty much how games like temple run work)

ridhwaan08

  • Posts: 288
is this like running? i suggest giving the player a variable type of x-movement where there is a max velocity set or x-speed limit.

I am working with phoenix,how could you do this
 :) :) :) :)
Nothing is impossible, the word itself says 'I'm possible'!

Audrey Hepburn

phoenix916

  • Posts: 23
Yes my concept is pretty much like "Temple Run".
But do I have to set a certain distance for the main player ? 
If the main player is faster than the enemies ... won't he run further and further away ?
So I'll have to set a limit for the main player? How can I do that ?

Medevenx

  • Posts: 65
maybe do something like

push towards x at Speed Force

if x-speed = Max Speed
set x-speed to Max Speed

try something like that, also, he'll probably run further away if he doesn't have much obstacles but maybe the trick to this is making the enemies speed be only a tiny value behind the player's speed so he won't take too much of a lead

phoenix916

  • Posts: 23
Or can I set it to be like Temple Run ?
The enemies show up when you slow down ?
Can that work ? How can I do so ?

Medevenx

  • Posts: 65
well if they only show up when you slow down how do you get them off the screen after that?

ridhwaan08

  • Posts: 288
you don't they just follow you until you get to the end
Nothing is impossible, the word itself says 'I'm possible'!

Audrey Hepburn