The Daily Click ::. Forums ::. Klik Coding Help ::. how do i make a active follow the player?
 

Post Reply  Post Oekaki 
 

Posted By Message

Videogameget



Registered
  03/07/2011
Points
  405
25th September, 2011 at 05:43:30 -

Im trying to but i can't! is there any solution?

 
In reconstruction.

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
25th September, 2011 at 11:40:12 -

Post your mfa file and I'll have a look at it

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
25th September, 2011 at 12:15:11 -

depends on how you want it to behave.

easiest way i can think of is, as long as the active is greater than some distance from the player, orient it in the direction of the player, and move it to the player. while it is less than some distance from the player, do not move it.

you could combine this with a pathfinding extension so that the active can find the player even behind walls and such.

 
n/a

Videogameget



Registered
  03/07/2011
Points
  405
25th September, 2011 at 21:37:53 -

i was thinking about, When Active passes through Active 2 witch is a trigger, it will follow the active but idk how.

 
In reconstruction.

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
25th September, 2011 at 22:48:54 -

that's what flags are for. when the player passes over the other active, turn a flag on. then use that flag to determine whether or not to do the code that makes the active follow the player.

 
n/a

Videogameget



Registered
  03/07/2011
Points
  405
25th September, 2011 at 23:55:18 -

I heard about flags but i have 0 experience of that but ill give it a try. But first i need to release for the first time alpha 1.30 OFFICIAL RELEASE... IM ALMOST DONE. They are in small episodes hehehe.

 
In reconstruction.

Videogameget



Registered
  03/07/2011
Points
  405
26th September, 2011 at 19:54:26 -

Does someone knows how to code the movement?

 
In reconstruction.

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
27th September, 2011 at 04:51:01 -

Post your mfa file and I'll show you.

 
n/a

MasterM



Registered
  02/01/2002
Points
  701

I am an April Fool
27th September, 2011 at 14:49:40 -

hi alfredo im not perfectly sure what you EXACTLY what / what you are exactly talking about. so since i dont know what exactly you want and how experienced you are the thing the The Cecilizer suggested seems to be the easiet thing you might want to give a try- i think you probably overlooked what he said?

just give your enemy some silly bouncing ball movement and say always look into direction of player and he will follow him. now you can fiddle around with this and improve it.

 
Image

Videogameget



Registered
  03/07/2011
Points
  405
27th September, 2011 at 22:35:49 -

OK THE GAME IS ZOMBIES... That is going to be my first leak. and im trying to send them to follow the player! Get it?

 
In reconstruction.

Videogameget



Registered
  03/07/2011
Points
  405
27th September, 2011 at 22:39:33 -

SWEET! I try to read again your post and the ball movement and look at the direction of the player was just GENIUS! Ill reduce the speed thanks!

 
In reconstruction.

Fordom

Nordanrikets konung

Registered
  12/02/2009
Points
  190

VIP Member
28th September, 2011 at 20:20:59 -



zombie.x > player.x:
zombie.x = zombie.x-zombievelocity

zombie.x < player.x:
zombie.x = zombie.x+zombievelocity

and for y

Thats the siplest method besides the ball movement

 
This forum is full of trolls and disinfo agents.

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th September, 2011 at 21:11:35 -

i never like that method fordom. it causes them to behave robotically, and less fluid. they get attracted to either axis in relation to the player, moving diagonally, until they reach an axis, then move in a straight line along the axis towards the player. its like using the ball movement with only 8 directions.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
29th September, 2011 at 02:47:30 -

is everybody making a game about zombies? lol
aside from that i use a very similar method with my zombies in celestia (you may wanna check it out to see if this is what you watn for your zombies)
http://www.create-games.com/download.asp?id=8496

I use the same method fordom posted, but he didnt exactly explain gravity for a terrain that isnt all flat, he explained how to move them left and right.
for gravity you would use
Zombie is overlapping ground (negated) - set Y position of zombie to Y position of zombie +3
So basically that just says if its not overlapping the ground, move it downward (i use 3 because its not too fast and not too slow.)
zombie is overlapping ground - set Y position of zombie to Y position of zombie -3
that just says if he is overlapping the ground, than move him up. works for me, they stay steady at ground level, and when going over a cliff fall at an accurate speed toward the ground. simple, but effective, for me anyway.

 
[Game design makes my brain feel like its gonna explode.]

Videogameget



Registered
  03/07/2011
Points
  405
30th September, 2011 at 00:20:20 -

I don't need that formula.

When active touches Active 2 that is a trigger.

Active Collision to ACTIVE 2

ACTIVE 2 STARTS Movement ACTIVE 3

ACTIVE 3 MOVES ON DIRECTION Towards ACTIVE 1

And thats it!

If you don't understand maybe research abit more because it was kinda confusing crack the code.

thank you people!

 
In reconstruction.
   

Post Reply



 



Advertisement

Worth A Click